Spaces:
Running
Running
Update index.html
Browse files- index.html +135 -141
index.html
CHANGED
|
@@ -1,143 +1,137 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 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 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
id="root"
|
| 139 |
-
style="display: flex; flex-direction: column; flex-grow: 1"
|
| 140 |
-
></div>
|
| 141 |
-
<script src="html2canvas.js"></script>
|
| 142 |
-
</body>
|
| 143 |
-
</html>
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>DALL·E Mini Generator</title>
|
| 7 |
+
<style>
|
| 8 |
+
body {
|
| 9 |
+
margin: 0;
|
| 10 |
+
padding: 0;
|
| 11 |
+
font-family: "Source Sans Pro", sans-serif;
|
| 12 |
+
background: linear-gradient(135deg, #ece9f7 0%, #d4f1f9 100%);
|
| 13 |
+
display: flex;
|
| 14 |
+
justify-content: center;
|
| 15 |
+
align-items: center;
|
| 16 |
+
min-height: 100vh;
|
| 17 |
+
}
|
| 18 |
+
|
| 19 |
+
.container {
|
| 20 |
+
background: #fff;
|
| 21 |
+
border-radius: 16px;
|
| 22 |
+
padding: 2rem;
|
| 23 |
+
box-shadow: 0 6px 30px rgba(0, 0, 0, 0.1);
|
| 24 |
+
max-width: 700px;
|
| 25 |
+
width: 100%;
|
| 26 |
+
text-align: center;
|
| 27 |
+
}
|
| 28 |
+
|
| 29 |
+
h1 {
|
| 30 |
+
margin-bottom: 0.5rem;
|
| 31 |
+
font-size: 1.8rem;
|
| 32 |
+
color: #333;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
p {
|
| 36 |
+
margin-bottom: 1.5rem;
|
| 37 |
+
font-size: 1rem;
|
| 38 |
+
color: #666;
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
input {
|
| 42 |
+
width: 100%;
|
| 43 |
+
padding: 0.8rem 1rem;
|
| 44 |
+
border-radius: 10px;
|
| 45 |
+
border: 1px solid #ddd;
|
| 46 |
+
margin-bottom: 1rem;
|
| 47 |
+
font-size: 1rem;
|
| 48 |
+
background: #fafafa;
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
input:focus {
|
| 52 |
+
outline: none;
|
| 53 |
+
border-color: #7b61ff;
|
| 54 |
+
box-shadow: 0 0 0 2px rgba(123, 97, 255, 0.2);
|
| 55 |
+
}
|
| 56 |
+
|
| 57 |
+
button {
|
| 58 |
+
background: linear-gradient(90deg, #7b61ff, #5eead4);
|
| 59 |
+
border: none;
|
| 60 |
+
color: white;
|
| 61 |
+
font-size: 1rem;
|
| 62 |
+
font-weight: 600;
|
| 63 |
+
padding: 0.8rem 1.6rem;
|
| 64 |
+
border-radius: 10px;
|
| 65 |
+
cursor: pointer;
|
| 66 |
+
transition: 0.2s ease;
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
button:hover {
|
| 70 |
+
transform: translateY(-2px);
|
| 71 |
+
background: linear-gradient(90deg, #5eead4, #7b61ff);
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
.gallery {
|
| 75 |
+
margin-top: 1.5rem;
|
| 76 |
+
display: grid;
|
| 77 |
+
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
|
| 78 |
+
gap: 1rem;
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
.gallery img {
|
| 82 |
+
width: 100%;
|
| 83 |
+
border-radius: 12px;
|
| 84 |
+
box-shadow: 0 2px 10px rgba(0,0,0,0.08);
|
| 85 |
+
background: #f9f9f9;
|
| 86 |
+
}
|
| 87 |
+
</style>
|
| 88 |
+
</head>
|
| 89 |
+
<body>
|
| 90 |
+
<div class="container">
|
| 91 |
+
<h1>🎨 DALL·E Mini Generator</h1>
|
| 92 |
+
<p>Generate AI-powered images from any text prompt.</p>
|
| 93 |
+
|
| 94 |
+
<input id="prompt" type="text" placeholder="Enter your prompt here..." />
|
| 95 |
+
<button onclick="generateImages()">Generate</button>
|
| 96 |
+
|
| 97 |
+
<div id="gallery" class="gallery"></div>
|
| 98 |
+
</div>
|
| 99 |
+
|
| 100 |
+
<script>
|
| 101 |
+
async function generateImages() {
|
| 102 |
+
const prompt = document.getElementById("prompt").value.trim();
|
| 103 |
+
const gallery = document.getElementById("gallery");
|
| 104 |
+
|
| 105 |
+
if (!prompt) {
|
| 106 |
+
alert("Please enter a prompt first!");
|
| 107 |
+
return;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
gallery.innerHTML = "<p>⏳ Generating images...</p>";
|
| 111 |
+
|
| 112 |
+
try {
|
| 113 |
+
const response = await fetch("https://bf.dallemini.ai/generate", {
|
| 114 |
+
method: "POST",
|
| 115 |
+
headers: {
|
| 116 |
+
"Content-Type": "application/json",
|
| 117 |
+
"Accept": "application/json",
|
| 118 |
+
},
|
| 119 |
+
body: JSON.stringify({ prompt }),
|
| 120 |
+
});
|
| 121 |
+
|
| 122 |
+
const data = await response.json();
|
| 123 |
+
gallery.innerHTML = "";
|
| 124 |
+
|
| 125 |
+
data.images.forEach(imgBase64 => {
|
| 126 |
+
const img = document.createElement("img");
|
| 127 |
+
img.src = "data:image/png;base64," + imgBase64;
|
| 128 |
+
gallery.appendChild(img);
|
| 129 |
+
});
|
| 130 |
+
} catch (error) {
|
| 131 |
+
console.error(error);
|
| 132 |
+
gallery.innerHTML = "<p>⚠️ Error: Too much traffic, try again later.</p>";
|
| 133 |
+
}
|
| 134 |
+
}
|
| 135 |
+
</script>
|
| 136 |
+
</body>
|
| 137 |
+
</html>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|