File size: 16,958 Bytes
e7670ac fd9d510 e7670ac fd9d510 e7670ac fd9d510 | 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 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 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 | <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ImaginAI - Text to Image Generator</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');
body {
font-family: 'Poppins', sans-serif;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
min-height: 100vh;
}
.gradient-bg {
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}
.result-container {
transition: all 0.3s ease;
}
.result-container:hover {
transform: translateY(-5px);
box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}
.loading-spinner {
width: 50px;
height: 50px;
border: 5px solid rgba(255, 255, 255, 0.3);
border-radius: 50%;
border-top-color: #fff;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}
.prompt-input:focus {
outline: none;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}
</style>
</head>
<body class="min-h-screen">
<header class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-magic text-2xl"></i>
<h1 class="text-2xl font-bold">ImaginAI</h1>
</div>
<nav>
<ul class="flex space-x-6">
<li><a href="#" class="hover:text-gray-200 transition">Home</a></li>
<li><a href="#" class="hover:text-gray-200 transition">Gallery</a></li>
<li><a href="#" class="hover:text-gray-200 transition">About</a></li>
</ul>
</nav>
</div>
</div>
</header>
<main class="container mx-auto px-4 py-12">
<section class="text-center mb-16">
<h2 class="text-4xl font-bold text-gray-800 mb-4">Turn Your Words Into Art</h2>
<p class="text-xl text-gray-600 max-w-2xl mx-auto">Describe your vision and our AI will generate stunning images for you. Try "A sunset over mountains with a lake reflection" or anything you can imagine!</p>
</section>
<section class="max-w-4xl mx-auto bg-white rounded-xl shadow-md overflow-hidden p-6 mb-12">
<div class="flex flex-col md:flex-row gap-6">
<div class="flex-1">
<div class="mb-6">
<label for="prompt" class="block text-gray-700 font-medium mb-2">Describe your image</label>
<textarea
id="prompt"
class="w-full prompt-input px-4 py-3 border border-gray-300 rounded-lg focus:border-indigo-500 focus:ring-1 focus:ring-indigo-500 transition"
rows="4"
placeholder="A futuristic cityscape at night with neon lights reflecting on wet streets..."
></textarea>
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Style</label>
<div class="grid grid-cols-2 md:grid-cols-4 gap-3">
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-indigo-50 transition" data-style="realistic">Realistic</button>
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-indigo-50 transition" data-style="fantasy">Fantasy</button>
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-indigo-50 transition" data-style="abstract">Abstract</button>
<button class="style-btn px-4 py-2 border rounded-lg hover:bg-indigo-50 transition" data-style="cartoon">Cartoon</button>
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Color Palette</label>
<div class="flex space-x-2">
<div class="color-option w-8 h-8 rounded-full bg-red-500 cursor-pointer border-2 border-white shadow" data-color="red"></div>
<div class="color-option w-8 h-8 rounded-full bg-blue-500 cursor-pointer border-2 border-white shadow" data-color="blue"></div>
<div class="color-option w-8 h-8 rounded-full bg-green-500 cursor-pointer border-2 border-white shadow" data-color="green"></div>
<div class="color-option w-8 h-8 rounded-full bg-yellow-500 cursor-pointer border-2 border-white shadow" data-color="yellow"></div>
<div class="color-option w-8 h-8 rounded-full bg-purple-500 cursor-pointer border-2 border-white shadow" data-color="purple"></div>
<div class="color-option w-8 h-8 rounded-full bg-pink-500 cursor-pointer border-2 border-white shadow" data-color="pink"></div>
</div>
</div>
<div class="flex justify-between items-center">
<div>
<label class="inline-flex items-center">
<input type="checkbox" class="rounded border-gray-300 text-indigo-600 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50" id="high-quality">
<span class="ml-2 text-gray-700">High Quality</span>
</label>
</div>
<button id="generate-btn" class="gradient-bg text-white px-6 py-3 rounded-lg font-medium hover:opacity-90 transition flex items-center">
<i class="fas fa-sparkles mr-2"></i> Generate Image
</button>
</div>
</div>
<div class="flex-1 flex items-center justify-center">
<div id="result-container" class="result-container w-full h-64 md:h-80 bg-gray-100 rounded-lg flex items-center justify-center overflow-hidden relative">
<div id="placeholder" class="text-center p-4">
<i class="fas fa-image text-4xl text-gray-400 mb-3"></i>
<p class="text-gray-500">Your generated image will appear here</p>
</div>
<div id="loading" class="hidden absolute inset-0 bg-black bg-opacity-50 flex items-center justify-center">
<div class="loading-spinner"></div>
</div>
<img id="generated-image" class="hidden w-full h-full object-cover" src="" alt="Generated image">
</div>
</div>
</div>
</section>
<section class="mb-12">
<h3 class="text-2xl font-bold text-gray-800 mb-6">Recent Creations</h3>
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition cursor-pointer">
<img src="https://source.unsplash.com/random/300x300/?fantasy" alt="Sample image" class="w-full h-48 object-cover">
<div class="p-4">
<p class="text-gray-600">"A dragon flying over a medieval castle"</p>
</div>
</div>
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition cursor-pointer">
<img src="https://source.unsplash.com/random/300x300/?cyberpunk" alt="Sample image" class="w-full h-48 object-cover">
<div class="p-4">
<p class="text-gray-600">"Neon-lit Tokyo street in rain"</p>
</div>
</div>
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition cursor-pointer">
<img src="https://source.unsplash.com/random/300x300/?portrait" alt="Sample image" class="w-full h-48 object-cover">
<div class="p-4">
<p class="text-gray-600">"Portrait of a cybernetic woman"</p>
</div>
</div>
<div class="bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition cursor-pointer">
<img src="https://source.unsplash.com/random/300x300/?landscape" alt="Sample image" class="w-full h-48 object-cover">
<div class="p-4">
<p class="text-gray-600">"Alpine meadow at sunrise"</p>
</div>
</div>
</div>
</section>
</main>
<footer class="bg-gray-800 text-white py-8">
<div class="container mx-auto px-4">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<h3 class="text-xl font-bold mb-2">ImaginAI</h3>
<p class="text-gray-400">Turning imagination into reality</p>
</div>
<div class="flex space-x-6">
<a href="#" class="hover:text-indigo-400 transition"><i class="fab fa-twitter"></i></a>
<a href="#" class="hover:text-indigo-400 transition"><i class="fab fa-instagram"></i></a>
<a href="#" class="hover:text-indigo-400 transition"><i class="fab fa-discord"></i></a>
<a href="#" class="hover:text-indigo-400 transition"><i class="fab fa-github"></i></a>
</div>
</div>
<div class="border-t border-gray-700 mt-6 pt-6 text-center text-gray-400">
<p>© 2023 ImaginAI. All rights reserved.</p>
</div>
</div>
</footer>
<script>
document.addEventListener('DOMContentLoaded', function() {
const generateBtn = document.getElementById('generate-btn');
const promptInput = document.getElementById('prompt');
const placeholder = document.getElementById('placeholder');
const loading = document.getElementById('loading');
const generatedImage = document.getElementById('generated-image');
const resultContainer = document.getElementById('result-container');
const styleButtons = document.querySelectorAll('.style-btn');
const colorOptions = document.querySelectorAll('.color-option');
const highQualityCheckbox = document.getElementById('high-quality');
let selectedStyle = 'realistic';
let selectedColor = '';
// Style selection
styleButtons.forEach(button => {
button.addEventListener('click', function() {
styleButtons.forEach(btn => btn.classList.remove('bg-indigo-100', 'border-indigo-500'));
this.classList.add('bg-indigo-100', 'border-indigo-500');
selectedStyle = this.dataset.style;
});
});
// Color selection
colorOptions.forEach(option => {
option.addEventListener('click', function() {
colorOptions.forEach(opt => opt.classList.remove('ring-2', 'ring-offset-2', 'ring-indigo-500'));
this.classList.add('ring-2', 'ring-offset-2', 'ring-indigo-500');
selectedColor = this.dataset.color;
});
});
// Generate image
generateBtn.addEventListener('click', function() {
const prompt = promptInput.value.trim();
if (!prompt) {
alert('Please enter a description for your image');
return;
}
// Show loading state
placeholder.classList.add('hidden');
loading.classList.remove('hidden');
generatedImage.classList.add('hidden');
generateBtn.disabled = true;
generateBtn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i> Generating...';
// Simulate API call with timeout
setTimeout(() => {
// In a real app, you would call an actual text-to-image API here
// For demo purposes, we'll use a placeholder image
const mockImages = [
'https://source.unsplash.com/random/600x600/?fantasy',
'https://source.unsplash.com/random/600x600/?landscape',
'https://source.unsplash.com/random/600x600/?future',
'https://source.unsplash.com/random/600x600/?abstract',
'https://source.unsplash.com/random/600x600/?cyberpunk'
];
const randomImage = mockImages[Math.floor(Math.random() * mockImages.length)];
generatedImage.src = randomImage;
generatedImage.alt = prompt;
generatedImage.onload = function() {
loading.classList.add('hidden');
generatedImage.classList.remove('hidden');
generateBtn.disabled = false;
generateBtn.innerHTML = '<i class="fas fa-sparkles mr-2"></i> Generate Image';
// Add to recent creations
addToRecentCreations(prompt, randomImage);
};
}, 2000);
});
// Add to recent creations (demo)
function addToRecentCreations(prompt, imageUrl) {
const recentContainer = document.querySelector('.grid-cols-1');
if (recentContainer) {
const newItem = document.createElement('div');
newItem.className = 'bg-white rounded-xl overflow-hidden shadow-md hover:shadow-lg transition cursor-pointer';
newItem.innerHTML = `
<img src="${imageUrl}" alt="Generated image" class="w-full h-48 object-cover">
<div class="p-4">
<p class="text-gray-600">"${prompt}"</p>
</div>
`;
recentContainer.prepend(newItem);
}
}
// Sample prompt suggestions
const samplePrompts = [
"A futuristic cityscape at night with neon lights",
"A mystical forest with glowing plants and fairies",
"A portrait of a cyberpunk samurai",
"An underwater city with coral skyscrapers",
"A steampunk airship flying over mountains"
];
// Rotate sample prompts in the placeholder
let currentPromptIndex = 0;
setInterval(() => {
promptInput.placeholder = samplePrompts[currentPromptIndex];
currentPromptIndex = (currentPromptIndex + 1) % samplePrompts.length;
}, 3000);
});
</script>
<p style="border-radius: 8px; text-align: center; font-size: 12px; color: #fff; margin-top: 16px;position: fixed; left: 8px; bottom: 8px; z-index: 10; background: rgba(0, 0, 0, 0.8); padding: 4px 8px;">Made with <img src="https://enzostvs-deepsite.hf.space/logo.svg" alt="DeepSite Logo" style="width: 16px; height: 16px; vertical-align: middle;display:inline-block;margin-right:3px;filter:brightness(0) invert(1);"><a href="https://enzostvs-deepsite.hf.space" style="color: #fff;text-decoration: underline;" target="_blank" >DeepSite</a> - 🧬 <a href="https://enzostvs-deepsite.hf.space?remix=pakar23/test" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html> |