kjamins / index.html
kjamin's picture
Add 3 files
52fe36d verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ImaginAI - AI 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>
@keyframes pulse {
0%, 100% { opacity: 1; }
50% { opacity: 0.5; }
}
.animate-pulse {
animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
.gradient-bg {
background: linear-gradient(135deg, #6e8efb, #a777e3);
}
.result-image {
transition: all 0.3s ease;
}
.result-image:hover {
transform: scale(1.02);
box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}
.prompt-input:focus {
box-shadow: 0 0 0 3px rgba(167, 119, 227, 0.3);
}
</style>
</head>
<body class="bg-gray-50 min-h-screen font-sans">
<div class="gradient-bg text-white py-4 shadow-lg">
<div class="container mx-auto px-4">
<div class="flex justify-between items-center">
<div class="flex items-center space-x-2">
<i class="fas fa-robot text-3xl"></i>
<h1 class="text-2xl font-bold">ImaginAI</h1>
</div>
<div class="hidden md:flex space-x-4">
<a href="#" class="hover:text-gray-200 transition">Home</a>
<a href="#" class="hover:text-gray-200 transition">Gallery</a>
<a href="#" class="hover:text-gray-200 transition">About</a>
</div>
<button class="md:hidden text-xl">
<i class="fas fa-bars"></i>
</button>
</div>
</div>
</div>
<main class="container mx-auto px-4 py-8">
<div class="max-w-4xl mx-auto text-center mb-12">
<h2 class="text-4xl font-bold text-gray-800 mb-4">Generate Stunning AI Art</h2>
<p class="text-xl text-gray-600">Describe your imagination and let our AI bring it to life</p>
</div>
<div class="bg-white rounded-xl shadow-lg p-6 mb-8">
<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">Your Imagination</label>
<textarea
id="prompt"
rows="4"
class="w-full px-4 py-3 border border-gray-300 rounded-lg prompt-input focus:outline-none focus:border-purple-500 transition"
placeholder="A majestic lion wearing a crown in the style of renaissance painting..."></textarea>
</div>
<div class="grid grid-cols-2 gap-4 mb-6">
<div>
<label for="style" class="block text-gray-700 font-medium mb-2">Art Style</label>
<select id="style" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:border-purple-500 transition">
<option value="realistic">Realistic</option>
<option value="fantasy">Fantasy</option>
<option value="anime">Anime</option>
<option value="watercolor">Watercolor</option>
<option value="oil-painting">Oil Painting</option>
<option value="digital-art">Digital Art</option>
</select>
</div>
<div>
<label for="quality" class="block text-gray-700 font-medium mb-2">Quality</label>
<select id="quality" class="w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:border-purple-500 transition">
<option value="standard">Standard</option>
<option value="hd">HD</option>
<option value="ultra-hd">Ultra HD</option>
</select>
</div>
</div>
<div class="mb-6">
<label class="block text-gray-700 font-medium mb-2">Advanced Options</label>
<div class="flex flex-wrap gap-3">
<label class="inline-flex items-center">
<input type="checkbox" class="rounded text-purple-500 focus:ring-purple-500">
<span class="ml-2 text-gray-600">High Detail</span>
</label>
<label class="inline-flex items-center">
<input type="checkbox" class="rounded text-purple-500 focus:ring-purple-500">
<span class="ml-2 text-gray-600">Dramatic Lighting</span>
</label>
<label class="inline-flex items-center">
<input type="checkbox" class="rounded text-purple-500 focus:ring-purple-500">
<span class="ml-2 text-gray-600">Symmetrical</span>
</label>
</div>
</div>
<button id="generate-btn" class="w-full gradient-bg text-white font-bold py-3 px-6 rounded-lg hover:opacity-90 transition flex items-center justify-center">
<i class="fas fa-magic mr-2"></i> Generate Image
</button>
</div>
<div class="flex-1">
<div class="border-2 border-dashed border-gray-300 rounded-xl h-full flex items-center justify-center bg-gray-50 min-h-[300px]">
<div id="image-container" class="p-4 w-full h-full flex items-center justify-center">
<div id="placeholder" class="text-center">
<i class="fas fa-image text-5xl text-gray-400 mb-4"></i>
<p class="text-gray-500">Your generated image will appear here</p>
</div>
<div id="loading" class="hidden text-center">
<div class="animate-pulse mb-4">
<i class="fas fa-spinner fa-spin text-5xl text-purple-500"></i>
</div>
<p class="text-gray-600">Creating your masterpiece...</p>
<p class="text-sm text-gray-500 mt-2">This usually takes 10-30 seconds</p>
</div>
<img id="result-image" class="hidden max-w-full max-h-[400px] rounded-lg result-image" src="" alt="Generated image">
</div>
</div>
</div>
</div>
</div>
<div class="mb-12">
<h3 class="text-2xl font-bold text-gray-800 mb-6">Inspiration Gallery</h3>
<div class="grid grid-cols-2 md:grid-cols-4 gap-4">
<div class="bg-white p-3 rounded-lg shadow hover:shadow-lg transition cursor-pointer" onclick="useExample('A cyberpunk cityscape at night with neon lights reflecting on wet streets')">
<img src="https://images.unsplash.com/photo-1518455027359-f3f8164ba6bd?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" alt="Cyberpunk city" class="w-full h-32 object-cover rounded mb-2">
<p class="text-sm text-gray-600">Cyberpunk City</p>
</div>
<div class="bg-white p-3 rounded-lg shadow hover:shadow-lg transition cursor-pointer" onclick="useExample('A mystical forest with glowing mushrooms and fairies, digital art style')">
<img src="https://images.unsplash.com/photo-1531279557251-b3854307669c?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" alt="Mystical forest" class="w-full h-32 object-cover rounded mb-2">
<p class="text-sm text-gray-600">Mystical Forest</p>
</div>
<div class="bg-white p-3 rounded-lg shadow hover:shadow-lg transition cursor-pointer" onclick="useExample('A futuristic spaceship landing on an alien planet with three moons in the sky')">
<img src="https://images.unsplash.com/photo-1457364887197-9150188c107b?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" alt="Futuristic spaceship" class="w-full h-32 object-cover rounded mb-2">
<p class="text-sm text-gray-600">Alien Planet</p>
</div>
<div class="bg-white p-3 rounded-lg shadow hover:shadow-lg transition cursor-pointer" onclick="useExample('A portrait of a beautiful elven queen with intricate jewelry, fantasy style')">
<img src="https://images.unsplash.com/photo-1534447677768-be436bb09401?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80" alt="Elven queen" class="w-full h-32 object-cover rounded mb-2">
<p class="text-sm text-gray-600">Elven Queen</p>
</div>
</div>
</div>
<div class="bg-white rounded-xl shadow-lg p-6">
<h3 class="text-2xl font-bold text-gray-800 mb-4">Your Recent Creations</h3>
<div id="history" class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4">
<div class="text-center py-8 text-gray-400">
<i class="fas fa-history text-3xl mb-2"></i>
<p>Your generated images will appear here</p>
</div>
</div>
</div>
</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">
<div class="flex items-center space-x-2">
<i class="fas fa-robot text-2xl"></i>
<span class="text-xl font-bold">ImaginAI</span>
</div>
<p class="text-gray-400 mt-2">Bringing your imagination to life</p>
</div>
<div class="flex space-x-6">
<a href="#" class="hover:text-purple-300 transition"><i class="fab fa-twitter"></i></a>
<a href="#" class="hover:text-purple-300 transition"><i class="fab fa-instagram"></i></a>
<a href="#" class="hover:text-purple-300 transition"><i class="fab fa-discord"></i></a>
<a href="#" class="hover:text-purple-300 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>&copy; 2023 ImaginAI. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// This is a mock implementation since we can't actually call AI APIs in this demo
// In a real app, you would call an API like OpenAI's DALL-E, Stable Diffusion, etc.
const generateBtn = document.getElementById('generate-btn');
const promptInput = document.getElementById('prompt');
const styleSelect = document.getElementById('style');
const qualitySelect = document.getElementById('quality');
const placeholder = document.getElementById('placeholder');
const loading = document.getElementById('loading');
const resultImage = document.getElementById('result-image');
const historyContainer = document.getElementById('history');
// Sample images for demonstration
const sampleImages = [
'https://images.unsplash.com/photo-1682686580391-615b4f716f24?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80',
'https://images.unsplash.com/photo-1682695796954-bad0d0f59ff1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80',
'https://images.unsplash.com/photo-1682686580391-615b4f716f24?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80',
'https://images.unsplash.com/photo-1682695796954-bad0d0f59ff1?ixlib=rb-4.0.3&ixid=M3wxMjA3fDF8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=500&q=80'
];
// Generate a random image from Unsplash based on prompt
function generateRandomImage(prompt) {
const randomNum = Math.floor(Math.random() * 1000);
return `https://source.unsplash.com/random/500x500/?${encodeURIComponent(prompt)}&${randomNum}`;
}
// Use example from gallery
function useExample(prompt) {
promptInput.value = prompt;
}
// Generate image
generateBtn.addEventListener('click', () => {
const prompt = promptInput.value.trim();
const style = styleSelect.value;
const quality = qualitySelect.value;
if (!prompt) {
alert('Please enter a description for your image');
return;
}
// Show loading state
placeholder.classList.add('hidden');
loading.classList.remove('hidden');
resultImage.classList.add('hidden');
// Simulate API call delay
setTimeout(() => {
// For demo purposes, we'll use a random Unsplash image
// In a real app, you would call an AI image generation API here
const imageUrl = generateRandomImage(prompt);
// Display result
resultImage.src = imageUrl;
loading.classList.add('hidden');
resultImage.classList.remove('hidden');
// Add to history
addToHistory(prompt, imageUrl);
}, 2000 + Math.random() * 3000); // Random delay between 2-5 seconds
});
// Add generated image to history
function addToHistory(prompt, imageUrl) {
// Create history item
const historyItem = document.createElement('div');
historyItem.className = 'bg-white rounded-lg overflow-hidden shadow hover:shadow-lg transition cursor-pointer';
historyItem.innerHTML = `
<img src="${imageUrl}" alt="${prompt}" class="w-full h-32 object-cover">
<div class="p-3">
<p class="text-sm text-gray-600 truncate">${prompt}</p>
<div class="flex justify-between items-center mt-2">
<span class="text-xs text-gray-500">${new Date().toLocaleDateString()}</span>
<button class="text-purple-500 hover:text-purple-700">
<i class="fas fa-download"></i>
</button>
</div>
</div>
`;
// If history is empty, remove the placeholder
if (historyContainer.children.length === 1 &&
historyContainer.children[0].querySelector('i.fa-history')) {
historyContainer.innerHTML = '';
}
// Add to beginning of history
historyContainer.prepend(historyItem);
// Limit history to 12 items
if (historyContainer.children.length > 12) {
historyContainer.removeChild(historyContainer.lastChild);
}
}
// Initialize with some sample history items for demo
function initDemoHistory() {
const samplePrompts = [
"A beautiful sunset over mountains",
"Futuristic city with flying cars",
"Magical unicorn in a enchanted forest",
"Steampunk airship in the clouds"
];
samplePrompts.forEach((prompt, index) => {
addToHistory(prompt, sampleImages[index % sampleImages.length]);
});
}
// Initialize demo data
initDemoHistory();
</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=kjamin/kjamins" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body>
</html>