Spaces:
Running
Running
can you create text to image app
Browse files- README.md +8 -5
- index.html +329 -18
README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
| 1 |
---
|
| 2 |
-
title:
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
|
|
|
|
|
|
| 8 |
---
|
| 9 |
|
| 10 |
-
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
title: DreamForge AI 🎨
|
| 3 |
+
colorFrom: pink
|
| 4 |
+
colorTo: purple
|
| 5 |
+
emoji: 🐳
|
| 6 |
sdk: static
|
| 7 |
pinned: false
|
| 8 |
+
tags:
|
| 9 |
+
- deepsite-v3
|
| 10 |
---
|
| 11 |
|
| 12 |
+
# Welcome to your new DeepSite project!
|
| 13 |
+
This project was created with [DeepSite](https://deepsite.hf.co).
|
index.html
CHANGED
|
@@ -1,19 +1,330 @@
|
|
| 1 |
-
<!
|
| 2 |
-
<html>
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
</html>
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en" class="dark">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>DreamForge AI - Text to Image Generator</title>
|
| 7 |
+
<link rel="icon" type="image/x-icon" href="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23a855f7'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
|
| 10 |
+
<script src="https://unpkg.com/feather-icons"></script>
|
| 11 |
+
<script src="https://cdn.jsdelivr.net/npm/animejs/lib/anime.iife.min.js"></script>
|
| 12 |
+
<script src="https://cdn.jsdelivr.net/npm/vanta@latest/dist/vanta.net.min.js"></script>
|
| 13 |
+
<style>
|
| 14 |
+
@keyframes float {
|
| 15 |
+
0%, 100% { transform: translateY(0px); }
|
| 16 |
+
50% { transform: translateY(-20px); }
|
| 17 |
+
}
|
| 18 |
+
.float-animation {
|
| 19 |
+
animation: float 6s ease-in-out infinite;
|
| 20 |
+
}
|
| 21 |
+
.glass-effect {
|
| 22 |
+
backdrop-filter: blur(16px) saturate(180%);
|
| 23 |
+
background-color: rgba(17, 25, 40, 0.75);
|
| 24 |
+
border: 1px solid rgba(255, 255, 255, 0.125);
|
| 25 |
+
}
|
| 26 |
+
.gradient-border {
|
| 27 |
+
position: relative;
|
| 28 |
+
background: linear-gradient(90deg, #a855f7, #ec4899, #3b82f6);
|
| 29 |
+
padding: 2px;
|
| 30 |
+
border-radius: 1rem;
|
| 31 |
+
}
|
| 32 |
+
.gradient-border > div {
|
| 33 |
+
background: #111827;
|
| 34 |
+
border-radius: calc(1rem - 2px);
|
| 35 |
+
}
|
| 36 |
+
</style>
|
| 37 |
+
</head>
|
| 38 |
+
<body class="bg-gray-900 text-white min-h-screen">
|
| 39 |
+
<div id="vanta-bg" class="fixed inset-0 z-0"></div>
|
| 40 |
+
|
| 41 |
+
<div class="relative z-10 min-h-screen">
|
| 42 |
+
<!-- Header -->
|
| 43 |
+
<header class="glass-effect fixed top-0 w-full z-50">
|
| 44 |
+
<nav class="container mx-auto px-6 py-4">
|
| 45 |
+
<div class="flex items-center justify-between">
|
| 46 |
+
<div class="flex items-center space-x-2">
|
| 47 |
+
<i data-feather="zap" class="w-8 h-8 text-purple-400"></i>
|
| 48 |
+
<h1 class="text-2xl font-bold bg-gradient-to-r from-purple-400 to-pink-400 bg-clip-text text-transparent">
|
| 49 |
+
DreamForge AI
|
| 50 |
+
</h1>
|
| 51 |
+
</div>
|
| 52 |
+
<div class="flex items-center space-x-4">
|
| 53 |
+
<button id="theme-toggle" class="p-2 rounded-lg hover:bg-gray-700 transition-colors">
|
| 54 |
+
<i data-feather="sun" class="w-5 h-5"></i>
|
| 55 |
+
</button>
|
| 56 |
+
<button class="p-2 rounded-lg hover:bg-gray-700 transition-colors">
|
| 57 |
+
<i data-feather="settings" class="w-5 h-5"></i>
|
| 58 |
+
</button>
|
| 59 |
+
</div>
|
| 60 |
+
</div>
|
| 61 |
+
</nav>
|
| 62 |
+
</header>
|
| 63 |
+
|
| 64 |
+
<!-- Main Content -->
|
| 65 |
+
<main class="container mx-auto px-6 pt-24 pb-12">
|
| 66 |
+
<div class="max-w-6xl mx-auto">
|
| 67 |
+
<!-- Hero Section -->
|
| 68 |
+
<div class="text-center mb-12">
|
| 69 |
+
<h2 class="text-5xl font-bold mb-4 bg-gradient-to-r from-purple-400 via-pink-400 to-blue-400 bg-clip-text text-transparent">
|
| 70 |
+
Transform Words into Art
|
| 71 |
+
</h2>
|
| 72 |
+
<p class="text-xl text-gray-300 max-w-2xl mx-auto">
|
| 73 |
+
Unleash your creativity with AI-powered text-to-image generation.
|
| 74 |
+
Describe your vision and watch it come to life.
|
| 75 |
+
</p>
|
| 76 |
+
</div>
|
| 77 |
+
|
| 78 |
+
<!-- Generation Section -->
|
| 79 |
+
<div class="grid lg:grid-cols-2 gap-8 mb-12">
|
| 80 |
+
<!-- Input Panel -->
|
| 81 |
+
<div class="space-y-6">
|
| 82 |
+
<div class="gradient-border">
|
| 83 |
+
<div class="p-6">
|
| 84 |
+
<h3 class="text-xl font-semibold mb-4 flex items-center">
|
| 85 |
+
<i data-feather="edit-3" class="w-5 h-5 mr-2 text-purple-400"></i>
|
| 86 |
+
Describe Your Vision
|
| 87 |
+
</h3>
|
| 88 |
+
<textarea
|
| 89 |
+
id="prompt-input"
|
| 90 |
+
class="w-full h-32 p-4 bg-gray-800 rounded-lg border border-gray-600 focus:border-purple-400 focus:outline-none resize-none"
|
| 91 |
+
placeholder="A mystical forest with glowing mushrooms and fireflies under a starlit sky..."
|
| 92 |
+
></textarea>
|
| 93 |
+
|
| 94 |
+
<div class="mt-4 space-y-4">
|
| 95 |
+
<div>
|
| 96 |
+
<label class="block text-sm font-medium mb-2">Style</label>
|
| 97 |
+
<select id="style-select" class="w-full p-3 bg-gray-800 rounded-lg border border-gray-600 focus:border-purple-400 focus:outline-none">
|
| 98 |
+
<option value="realistic">Realistic</option>
|
| 99 |
+
<option value="anime">Anime</option>
|
| 100 |
+
<option value="oil-painting">Oil Painting</option>
|
| 101 |
+
<option value="digital-art">Digital Art</option>
|
| 102 |
+
<option value="photographic">Photographic</option>
|
| 103 |
+
<option value="fantasy">Fantasy</option>
|
| 104 |
+
</select>
|
| 105 |
+
</div>
|
| 106 |
+
|
| 107 |
+
<div>
|
| 108 |
+
<label class="block text-sm font-medium mb-2">Aspect Ratio</label>
|
| 109 |
+
<div class="grid grid-cols-3 gap-2">
|
| 110 |
+
<button class="aspect-btn p-2 bg-gray-800 rounded-lg border border-gray-600 hover:border-purple-400 transition-colors" data-ratio="1:1">
|
| 111 |
+
<i data-feather="square" class="w-4 h-4 mx-auto"></i>
|
| 112 |
+
<span class="text-xs">1:1</span>
|
| 113 |
+
</button>
|
| 114 |
+
<button class="aspect-btn p-2 bg-gray-800 rounded-lg border border-gray-600 hover:border-purple-400 transition-colors" data-ratio="16:9">
|
| 115 |
+
<i data-feather="monitor" class="w-4 h-4 mx-auto"></i>
|
| 116 |
+
<span class="text-xs">16:9</span>
|
| 117 |
+
</button>
|
| 118 |
+
<button class="aspect-btn p-2 bg-gray-800 rounded-lg border border-gray-600 hover:border-purple-400 transition-colors" data-ratio="9:16">
|
| 119 |
+
<i data-feather="smartphone" class="w-4 h-4 mx-auto"></i>
|
| 120 |
+
<span class="text-xs">9:16</span>
|
| 121 |
+
</button>
|
| 122 |
+
</div>
|
| 123 |
+
</div>
|
| 124 |
+
</div>
|
| 125 |
+
|
| 126 |
+
<button
|
| 127 |
+
id="generate-btn"
|
| 128 |
+
class="w-full mt-6 py-3 bg-gradient-to-r from-purple-500 to-pink-500 rounded-lg font-semibold hover:from-purple-600 hover:to-pink-600 transition-all transform hover:scale-105"
|
| 129 |
+
>
|
| 130 |
+
<span class="flex items-center justify-center">
|
| 131 |
+
<i data-feather="sparkles" class="w-5 h-5 mr-2"></i>
|
| 132 |
+
Generate Image
|
| 133 |
+
</span>
|
| 134 |
+
</button>
|
| 135 |
+
</div>
|
| 136 |
+
</div>
|
| 137 |
+
|
| 138 |
+
<!-- Advanced Options -->
|
| 139 |
+
<div class="glass-effect rounded-lg p-4">
|
| 140 |
+
<button class="w-full flex items-center justify-between" onclick="toggleAdvanced()">
|
| 141 |
+
<span class="font-medium">Advanced Options</span>
|
| 142 |
+
<i id="advanced-icon" data-feather="chevron-down" class="w-4 h-4"></i>
|
| 143 |
+
</button>
|
| 144 |
+
<div id="advanced-panel" class="hidden mt-4 space-y-4">
|
| 145 |
+
<div>
|
| 146 |
+
<label class="block text-sm font-medium mb-2">Guidance Scale</label>
|
| 147 |
+
<input type="range" min="1" max="20" value="7" class="w-full">
|
| 148 |
+
</div>
|
| 149 |
+
<div>
|
| 150 |
+
<label class="block text-sm font-medium mb-2">Steps</label>
|
| 151 |
+
<input type="range" min="10" max="100" value="50" class="w-full">
|
| 152 |
+
</div>
|
| 153 |
+
</div>
|
| 154 |
+
</div>
|
| 155 |
+
</div>
|
| 156 |
+
|
| 157 |
+
<!-- Output Panel -->
|
| 158 |
+
<div class="space-y-6">
|
| 159 |
+
<div class="glass-effect rounded-lg p-6">
|
| 160 |
+
<h3 class="text-xl font-semibold mb-4 flex items-center">
|
| 161 |
+
<i data-feather="image" class="w-5 h-5 mr-2 text-purple-400"></i>
|
| 162 |
+
Generated Image
|
| 163 |
+
</h3>
|
| 164 |
+
|
| 165 |
+
<div id="image-container" class="relative">
|
| 166 |
+
<div id="placeholder" class="aspect-square bg-gray-800 rounded-lg flex items-center justify-center">
|
| 167 |
+
<div class="text-center">
|
| 168 |
+
<i data-feather="image" class="w-16 h-16 mx-auto mb-4 text-gray-600"></i>
|
| 169 |
+
<p class="text-gray-500">Your generated image will appear here</p>
|
| 170 |
+
</div>
|
| 171 |
+
</div>
|
| 172 |
+
|
| 173 |
+
<div id="loading" class="hidden absolute inset-0 bg-gray-900 bg-opacity-75 rounded-lg flex items-center justify-center">
|
| 174 |
+
<div class="text-center">
|
| 175 |
+
<div class="w-16 h-16 mx-auto mb-4">
|
| 176 |
+
<div class="w-full h-full border-4 border-purple-400 border-t-transparent rounded-full animate-spin"></div>
|
| 177 |
+
</div>
|
| 178 |
+
<p class="text-purple-400">Conjuring your vision...</p>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
|
| 182 |
+
<img id="generated-image" class="hidden w-full rounded-lg" alt="Generated image">
|
| 183 |
+
</div>
|
| 184 |
+
|
| 185 |
+
<div id="actions" class="hidden mt-4 flex space-x-2">
|
| 186 |
+
<button class="flex-1 py-2 bg-purple-600 rounded-lg hover:bg-purple-700 transition-colors">
|
| 187 |
+
<i data-feather="download" class="w-4 h-4 inline mr-2"></i>
|
| 188 |
+
Download
|
| 189 |
+
</button>
|
| 190 |
+
<button class="flex-1 py-2 bg-gray-700 rounded-lg hover:bg-gray-600 transition-colors">
|
| 191 |
+
<i data-feather="share-2" class="w-4 h-4 inline mr-2"></i>
|
| 192 |
+
Share
|
| 193 |
+
</button>
|
| 194 |
+
<button class="flex-1 py-2 bg-gray-700 rounded-lg hover:bg-gray-600 transition-colors">
|
| 195 |
+
<i data-feather="refresh-cw" class="w-4 h-4 inline mr-2"></i>
|
| 196 |
+
Regenerate
|
| 197 |
+
</button>
|
| 198 |
+
</div>
|
| 199 |
+
</div>
|
| 200 |
+
</div>
|
| 201 |
+
</div>
|
| 202 |
+
|
| 203 |
+
<!-- Gallery Section -->
|
| 204 |
+
<div>
|
| 205 |
+
<h3 class="text-2xl font-semibold mb-6 flex items-center">
|
| 206 |
+
<i data-feather="grid" class="w-6 h-6 mr-2 text-purple-400"></i>
|
| 207 |
+
Recent Creations
|
| 208 |
+
</h3>
|
| 209 |
+
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
|
| 210 |
+
<div class="aspect-square bg-gray-800 rounded-lg overflow-hidden hover:scale-105 transition-transform cursor-pointer">
|
| 211 |
+
<img src="http://static.photos/nature/640x640/1" alt="Gallery" class="w-full h-full object-cover">
|
| 212 |
+
</div>
|
| 213 |
+
<div class="aspect-square bg-gray-800 rounded-lg overflow-hidden hover:scale-105 transition-transform cursor-pointer">
|
| 214 |
+
<img src="http://static.photos/abstract/640x640/2" alt="Gallery" class="w-full h-full object-cover">
|
| 215 |
+
</div>
|
| 216 |
+
<div class="aspect-square bg-gray-800 rounded-lg overflow-hidden hover:scale-105 transition-transform cursor-pointer">
|
| 217 |
+
<img src="http://static.photos/fantasy/640x640/3" alt="Gallery" class="w-full h-full object-cover">
|
| 218 |
+
</div>
|
| 219 |
+
<div class="aspect-square bg-gray-800 rounded-lg overflow-hidden hover:scale-105 transition-transform cursor-pointer">
|
| 220 |
+
<img src="http://static.photos/digital-art/640x640/4" alt="Gallery" class="w-full h-full object-cover">
|
| 221 |
+
</div>
|
| 222 |
+
</div>
|
| 223 |
+
</div>
|
| 224 |
+
</div>
|
| 225 |
+
</main>
|
| 226 |
+
</div>
|
| 227 |
+
|
| 228 |
+
<script>
|
| 229 |
+
// Initialize Vanta.js background
|
| 230 |
+
VANTA.NET({
|
| 231 |
+
el: "#vanta-bg",
|
| 232 |
+
mouseControls: true,
|
| 233 |
+
touchControls: true,
|
| 234 |
+
gyroControls: false,
|
| 235 |
+
minHeight: 200.00,
|
| 236 |
+
minWidth: 200.00,
|
| 237 |
+
scale: 1.00,
|
| 238 |
+
scaleMobile: 1.00,
|
| 239 |
+
color: 0x8b5cf6,
|
| 240 |
+
backgroundColor: 0x111827,
|
| 241 |
+
points: 10.00,
|
| 242 |
+
maxDistance: 25.00,
|
| 243 |
+
spacing: 20.00
|
| 244 |
+
});
|
| 245 |
+
|
| 246 |
+
// Feather icons
|
| 247 |
+
feather.replace();
|
| 248 |
+
|
| 249 |
+
// Theme toggle
|
| 250 |
+
const themeToggle = document.getElementById('theme-toggle');
|
| 251 |
+
themeToggle.addEventListener('click', () => {
|
| 252 |
+
document.documentElement.classList.toggle('dark');
|
| 253 |
+
const icon = themeToggle.querySelector('i');
|
| 254 |
+
if (document.documentElement.classList.contains('dark')) {
|
| 255 |
+
icon.setAttribute('data-feather', 'moon');
|
| 256 |
+
} else {
|
| 257 |
+
icon.setAttribute('data-feather', 'sun');
|
| 258 |
+
}
|
| 259 |
+
feather.replace();
|
| 260 |
+
});
|
| 261 |
+
|
| 262 |
+
// Advanced options toggle
|
| 263 |
+
function toggleAdvanced() {
|
| 264 |
+
const panel = document.getElementById('advanced-panel');
|
| 265 |
+
const icon = document.getElementById('advanced-icon');
|
| 266 |
+
panel.classList.toggle('hidden');
|
| 267 |
+
icon.style.transform = panel.classList.contains('hidden') ? 'rotate(0deg)' : 'rotate(180deg)';
|
| 268 |
+
}
|
| 269 |
+
|
| 270 |
+
// Aspect ratio selection
|
| 271 |
+
document.querySelectorAll('.aspect-btn').forEach(btn => {
|
| 272 |
+
btn.addEventListener('click', () => {
|
| 273 |
+
document.querySelectorAll('.aspect-btn').forEach(b => b.classList.remove('border-purple-400'));
|
| 274 |
+
btn.classList.add('border-purple-400');
|
| 275 |
+
});
|
| 276 |
+
});
|
| 277 |
+
|
| 278 |
+
// Generate image
|
| 279 |
+
document.getElementById('generate-btn').addEventListener('click', async () => {
|
| 280 |
+
const prompt = document.getElementById('prompt-input').value;
|
| 281 |
+
if (!prompt.trim()) {
|
| 282 |
+
alert('Please enter a prompt');
|
| 283 |
+
return;
|
| 284 |
+
}
|
| 285 |
+
|
| 286 |
+
const placeholder = document.getElementById('placeholder');
|
| 287 |
+
const loading = document.getElementById('loading');
|
| 288 |
+
const image = document.getElementById('generated-image');
|
| 289 |
+
const actions = document.getElementById('actions');
|
| 290 |
+
|
| 291 |
+
placeholder.classList.add('hidden');
|
| 292 |
+
loading.classList.remove('hidden');
|
| 293 |
+
|
| 294 |
+
// Simulate API call
|
| 295 |
+
setTimeout(() => {
|
| 296 |
+
loading.classList.add('hidden');
|
| 297 |
+
image.src = `https://image.pollinations.ai/prompt/${encodeURIComponent(prompt)}?width=512&height=512`;
|
| 298 |
+
image.classList.remove('hidden');
|
| 299 |
+
actions.classList.remove('hidden');
|
| 300 |
+
|
| 301 |
+
// Animate image appearance
|
| 302 |
+
anime({
|
| 303 |
+
targets: image,
|
| 304 |
+
opacity: [0, 1],
|
| 305 |
+
scale: [0.9, 1],
|
| 306 |
+
duration: 800,
|
| 307 |
+
easing: 'easeOutExpo'
|
| 308 |
+
});
|
| 309 |
+
}, 2000);
|
| 310 |
+
});
|
| 311 |
+
|
| 312 |
+
// Animate elements on load
|
| 313 |
+
anime({
|
| 314 |
+
targets: '.text-center h2, .text-center p',
|
| 315 |
+
opacity: [0, 1],
|
| 316 |
+
translateY: [30, 0],
|
| 317 |
+
duration: 1000,
|
| 318 |
+
delay: anime.stagger(200)
|
| 319 |
+
});
|
| 320 |
+
|
| 321 |
+
anime({
|
| 322 |
+
targets: '.gradient-border',
|
| 323 |
+
opacity: [0, 1],
|
| 324 |
+
translateY: [50, 0],
|
| 325 |
+
duration: 1000,
|
| 326 |
+
delay: 400
|
| 327 |
+
});
|
| 328 |
+
</script>
|
| 329 |
+
</body>
|
| 330 |
</html>
|