-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
25 lines (21 loc) · 808 Bytes
/
script.js
File metadata and controls
25 lines (21 loc) · 808 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function generateImage() {
const prompt = document.getElementById('prompt').value;
const loading = document.getElementById('loading');
const output = document.getElementById('output');
const printBtn = document.getElementById('printBtn');
if (!prompt) {
alert('Please describe your coloring sheet!');
return;
}
loading.style.display = 'block';
output.innerHTML = '';
printBtn.style.display = 'none';
// Simulate placeholder image generation
setTimeout(() => {
// Use this URL instead
const placeholderUrl = `https://dummyimage.com/600x400/ffffff/000000&text=${encodeURIComponent(prompt)}`;
output.innerHTML = `<img src="${placeholderUrl}" alt="Coloring Sheet">`;
loading.style.display = 'none';
printBtn.style.display = 'inline-block';
}, 2000);
}