Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
.env
1 change: 1 addition & 0 deletions Book Lookup/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<li><a href="../Book-List-Generator.html">Book List Generator</a></li>
<li><a href="../Not at all chores.html">Not At All Chores</a></li>
<li><a href="index.html">Book Lookup</a></li>
<li><a href="../xmas-image-generator/index.html">Christmas Image Generator</a></li>
</ul>
</nav>
<div class="content">
Expand Down
1 change: 1 addition & 0 deletions Book-List-Generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<li><a href="Book-List-Generator.html">Book List Generator</a></li>
<li><a href="Not at all chores.html">Not At All Chores</a></li>
<li><a href="Book Lookup/index.html">Book Lookup</a></li>
<li><a href="xmas-image-generator/index.html">Christmas Image Generator</a></li>
</ul>
</nav>
<h1>Library Book HTML Generator</h1>
Expand Down
29 changes: 19 additions & 10 deletions Not at all chores.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Random Song generator</title>
<link rel='stylesheet' href='./assets/css/grcstyle.css'>
<link rel='stylesheet' href='./assets/css/grcstyle.css'>
<style>
body {
font-family: 'Georgia', bold, italic;
Expand Down Expand Up @@ -46,21 +46,22 @@
</style>
</head>
<body>
<nav>
<nav>
<ul>
<li><a href="index.html">Home</a></li>
<li><a href="index.html">Home</a></li>
<li><a href="Random Task Generator.html">Random Task Generator</a></li>
<li><a href="Book-List-Generator.html">Book List Generator</a></li>
<li><a href="Not at all chores.html">Not At All Chores</a></li>
<li><a href="Book Lookup/index.html">Book Lookup</a></li>
<li><a href="Book-List-Generator.html">Book List Generator</a></li>
<li><a href="Not at all chores.html">Not At All Chores</a></li>
<li><a href="Book Lookup/index.html">Book Lookup</a></li>
<li><a href="xmas-image-generator/index.html">Christmas Image Generator</a></li>
</ul>
</nav>
<h1>Random Task Generator</h1>
<div id="panel">
<div id="field_name">Music is Medicine</div>
</div>
<div id="gifContainer">
<img src="Whatmeworry.gif" alt="Pixel art beard man shrugs" id="shrugGif">
<img src="./Shrug.gif" alt="Pixel art beard man shrugs" id="shrugGif">
</div>
<button id="generateBtn">Take the decision out of my hands</button>
<div id="result"></div>
Expand All @@ -75,7 +76,7 @@ <h1>Random Task Generator</h1>
"Burn and Release",
"Ropongi",
"Feelin' Fine (Fear)",
"WBirds of a Feather",
"Birds of a Feather",
"Learn to live without you",
"Best Dressed",
"Be Mild",
Expand All @@ -94,11 +95,19 @@ <h1>Random Task Generator</h1>
"Lilly Rose",
"Vicious Rumours",
"Women Strange",
"Year of OUr Lord 2012",
"Year of Our Lord 2012",
"The Colour is Red",
"the Surfer",
"Long is the Road",
"the Cukhold's Lament"
"the Cukhold's Lament",
"All your Bass",
"Black Irish",
"Gillards Hill",
"Home - Ben's Song",
"Five Eyes",
"Heart Bleeds Red",
"I'm Aware",

];

const generateBtn = document.getElementById('generateBtn');
Expand Down
1 change: 1 addition & 0 deletions Random Task Generator.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
<li><a href="Book-List-Generator.html">Book List Generator</a></li>
<li><a href="Not at all chores.html">Not At All Chores</a></li>
<li><a href="Book Lookup/index.html">Book Lookup</a></li>
<li><a href="xmas-image-generator/index.html">Christmas Image Generator</a></li>
</ul>
</nav>
<h1>Random Task Generator</h1>
Expand Down
33 changes: 33 additions & 0 deletions api/generate-image.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const OpenAI = require('openai');
const formidable = require('formidable');
const fs = require('fs');

module.exports = async (req, res) => {
const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

const form = new formidable.IncomingForm();
form.parse(req, async (err, fields, files) => {
if (err) {
res.status(500).json({ error: 'Error parsing form data' });
return;
}

const imageFile = files.image;

try {
const image = await openai.images.edit({
image: fs.createReadStream(imageFile.path),
prompt: 'Add a santa hat to the person in the image',
n: 1,
size: '1024x1024',
});

res.status(200).json({ imageUrl: image.data[0].url });
} catch (error) {
console.error('Error from OpenAI:', error);
res.status(500).json({ error: 'Error generating image' });
}
});
};
32 changes: 32 additions & 0 deletions assets/css/xmasstyle.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
body {
background-color: #f0f8ff;
}

h1 {
color: #333;
}

#video {
border: 3px solid #ccc;
display: block;
margin: 0 auto;
}

#snap {
display: block;
margin: 10px auto;
padding: 10px 20px;
background-color: #4CAF50;
color: white;
border: none;
cursor: pointer;
}

#canvas {
display: none;
}

#image-container {
margin-top: 20px;
text-align: center;
}
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<li><a href="Book-List-Generator.html">Book List Generator</a></li>
<li><a href="Not at all chores.html">Not At All Chores</a></li>
<li><a href="Book Lookup/index.html">Book Lookup</a></li>
<li><a href="xmas-image-generator/index.html">Christmas Image Generator</a></li>
</ul>
</nav>

Expand Down
107 changes: 107 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"name": "app",
"version": "1.0.0",
"description": "I'm Will I like making things, mostly music and photography but as of today code. Yum Yum code give me all the code I design educational programs(activities) at libraries. Pronouns:He/Him willisaverb@gmail.com",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/willisaverb/Library-Tool-Box.git"
},
"keywords": [],
"author": "",
"license": "ISC",
"type": "commonjs",
"bugs": {
"url": "https://github.com/willisaverb/Library-Tool-Box/issues"
},
"homepage": "https://github.com/willisaverb/Library-Tool-Box#readme",
"dependencies": {
"formidable": "^3.5.4",
"openai": "^6.10.0"
}
}
Binary file added xmas-image-generator/.DS_Store
Binary file not shown.
Binary file not shown.
69 changes: 69 additions & 0 deletions xmas-image-generator/christmas-project/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<!DOCTYPE html>
<html>
<head>
<title>🎄 Christmas Webcam Generator</title>
<style>
body {
font-family: Arial, sans-serif;
max-width: 600px;
margin: 0 auto;
padding: 20px;
text-align: center;
}
video {
width: 100%;
max-width: 400px;
border: 2px solid #c62828;
border-radius: 10px;
}
button {
background: #c62828;
color: white;
border: none;
padding: 15px 30px;
margin: 15px 5px;
cursor: pointer;
border-radius: 5px;
font-size: 16px;
}
button:hover { background: #b71c1c; }
button:disabled { background: #ccc; cursor: not-allowed; }
#result {
margin: 20px 0;
padding: 15px;
background: #f5f5f5;
border-radius: 5px;
min-height: 50px;
}
img {
max-width: 100%;
border-radius: 10px;
margin-top: 20px;
}
</style>
</head>
<body>
<h1>🎄 Christmas Webcam Generator</h1>

<video id="video" autoplay playsinline></video>

<div>
<button id="start-btn">Start Camera</button>
<button id="capture-btn" disabled>Capture & Christmas-fy!</button>
</div>

<canvas id="canvas" style="display:none;"></canvas>
<div id="result">Ready to create Christmas magic! 🎅</div>

<script>
let stream = null;
const video = document.getElementById('video');
const canvas = document.getElementById('canvas');
const ctx = canvas.getContext('2d');

// Start camera
document.getElementById('start-btn').addEventListener('click', async function() {
try {
stream = await navigator.mediaDevices.getUserMedia({ video: true });
video.srcObject = stream;
document.getElementById('capture
7 changes: 7 additions & 0 deletions xmas-image-generator/christmas-project/netlify.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[build]
functions = "netlify/functions"

[[redirects]]
from = "/api/*"
to = "/.netlify/functions/:splat"
status = 200
Binary file not shown.
Binary file not shown.
Loading