-
Notifications
You must be signed in to change notification settings - Fork 39
/
page.html
79 lines (66 loc) · 2.74 KB
/
page.html
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="page.css">
<title>AI Image Generator</title>
</head>
<body class="page">
<header>
<div class="header">
<a id="imgNI">imgNi.com</a>
<a id="contact">contact</a>
<a id="home">home</a>
<a id="about">about</a>
<a id="help">help</a>
</div>
</header>
<div class="mainbody">
<div class="container">
<h1>AI Image Generator</h1>
<form id="imageForm">
<label for="imageDescription">Enter image description:</label>
<input type="text" id="imageDescription" placeholder="Describe your image...">
<button type="submit">Generate Images</button>
</form>
<div class="image-gallery" id="imageGallery">
<!-- Generated images will appear here -->
</div>
</div>
</div>
<footer>
<div id="box3">
contact us:imgIN.com
</div>
</footer>
<script>
const form = document.getElementById('imageForm');
const gallery = document.getElementById('imageGallery');
form.addEventListener('submit', async (e) => {
e.preventDefault();
const description = document.getElementById('imageDescription').value;
const numImages = 5; // You can adjust this as needed
// Call your AI API here to generate images based on the description
// Update the gallery with the generated images (base64 or URLs)
// Example: fetchImages(description, numImages);
// For demonstration purposes, let's add placeholder images
const placeholderImage = 'data:image/png;base64,iVBORw0KG...'; // Base64-encoded image
for (let i = 0; i < numImages; i++) {
const imageCard = document.createElement('div');
imageCard.className = 'image-card';
const img = document.createElement('img');
img.src = placeholderImage;
imageCard.appendChild(img);
const downloadLink = document.createElement('a');
downloadLink.href = placeholderImage;
downloadLink.download = `image_${i + 1}.png`;
downloadLink.className = 'download-button';
downloadLink.textContent = 'Download';
imageCard.appendChild(downloadLink);
gallery.appendChild(imageCard);
}
});
</script>
</body>
</html>