Spaces:
Running
Running
File size: 12,905 Bytes
6590e5d 6ac3b50 |
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 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Prompt Analyzer Pro</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/feather-icons"></script>
<script src="https://cdn.jsdelivr.net/npm/feather-icons/dist/feather.min.js"></script>
<style>
.gradient-bg {
background: linear-gradient(135deg, #6e8efb 0%, #a777e3 100%);
}
.dropzone {
border: 2px dashed #a777e3;
transition: all 0.3s ease;
}
.dropzone-active {
border-color: #6e8efb;
background-color: rgba(110, 142, 251, 0.1);
}
.prompt-card {
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.prompt-card: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);
}
</style>
</head>
<body class="min-h-screen bg-gray-50">
<!-- Header -->
<header class="gradient-bg text-white shadow-lg">
<div class="container mx-auto px-4 py-6">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex items-center mb-4 md:mb-0">
<i data-feather="camera" class="w-8 h-8 mr-2"></i>
<h1 class="text-2xl font-bold">Prompt Analyzer Pro</h1>
</div>
<nav class="flex space-x-6">
<a href="#" class="hover:text-gray-200 font-medium">Home</a>
<a href="#" class="hover:text-gray-200 font-medium">How It Works</a>
<a href="#" class="hover:text-gray-200 font-medium">API</a>
</nav>
</div>
</div>
</header>
<!-- Hero Section -->
<section class="gradient-bg text-white py-16">
<div class="container mx-auto px-4 text-center">
<h2 class="text-4xl font-bold mb-4">Extract Perfect Prompts from Any Image</h2>
<p class="text-xl mb-8 max-w-2xl mx-auto">Upload an image or paste a URL to get detailed prompt analysis in both human-readable and JSON formats.</p>
<div class="max-w-2xl mx-auto bg-white rounded-lg shadow-xl overflow-hidden">
<div class="p-1 gradient-bg">
<div class="bg-white p-4 rounded">
<div id="dropzone" class="dropzone rounded-lg p-8 text-center cursor-pointer">
<i data-feather="upload-cloud" class="w-12 h-12 mx-auto text-purple-500 mb-4"></i>
<h3 class="text-lg font-semibold text-gray-800 mb-2">Drag & Drop Image Here</h3>
<p class="text-gray-600 mb-4">or click to browse files</p>
<input type="file" id="fileInput" class="hidden" accept="image/*">
<input type="text" id="urlInput" placeholder="Or paste image URL here" class="w-full px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500">
</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section class="py-16 bg-white">
<div class="container mx-auto px-4">
<div class="text-center mb-12">
<h2 class="text-3xl font-bold text-gray-800 mb-4">Powerful Prompt Analysis</h2>
<p class="text-gray-600 max-w-2xl mx-auto">Our AI extracts comprehensive metadata and generates perfect prompts for AI image generation.</p>
</div>
<div class="grid grid-cols-1 md:grid-cols-3 gap-8">
<div class="prompt-card bg-gray-50 p-6 rounded-xl">
<div class="w-12 h-12 gradient-bg rounded-full flex items-center justify-center mb-4">
<i data-feather="file-text" class="w-6 h-6 text-white"></i>
</div>
<h3 class="text-xl font-semibold mb-2 text-gray-800">Detailed Text Prompt</h3>
<p class="text-gray-600">Get a comprehensive, human-readable description of all image elements.</p>
</div>
<div class="prompt-card bg-gray-50 p-6 rounded-xl">
<div class="w-12 h-12 gradient-bg rounded-full flex items-center justify-center mb-4">
<i data-feather="code" class="w-6 h-6 text-white"></i>
</div>
<h3 class="text-xl font-semibold mb-2 text-gray-800">Structured JSON Data</h3>
<p class="text-gray-600">Receive machine-readable metadata in perfect JSON format.</p>
</div>
<div class="prompt-card bg-gray-50 p-6 rounded-xl">
<div class="w-12 h-12 gradient-bg rounded-full flex items-center justify-center mb-4">
<i data-feather="zap" class="w-6 h-6 text-white"></i>
</div>
<h3 class="text-xl font-semibold mb-2 text-gray-800">Instant Results</h3>
<p class="text-gray-600">Analyze images in seconds with our optimized AI pipeline.</p>
</div>
</div>
</div>
</section>
<!-- Results Section -->
<section class="py-16 bg-gray-50">
<div class="container mx-auto px-4">
<h2 class="text-3xl font-bold text-center mb-12 text-gray-800">Example Analysis Output</h2>
<div class="grid grid-cols-1 lg:grid-cols-2 gap-8">
<!-- Text Prompt Card -->
<div class="prompt-card bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center mb-4">
<i data-feather="file-text" class="w-6 h-6 text-purple-500 mr-2"></i>
<h3 class="text-xl font-semibold text-gray-800">Text Prompt</h3>
</div>
<div class="bg-gray-50 p-4 rounded-lg">
<pre class="text-gray-800 whitespace-pre-wrap font-mono text-sm">A serene landscape at sunset featuring a calm lake reflecting the vibrant colors of the sky, surrounded by lush green pine trees. In the foreground, a wooden dock extends into the water with a red canoe tied to it. The scene has warm golden hour lighting with soft clouds partially covering the sun. The composition is cinematic with a shallow depth of field, shot on a professional DSLR camera with a 50mm lens.</pre>
</div>
<button class="mt-4 gradient-bg text-white px-4 py-2 rounded-lg hover:opacity-90 transition flex items-center">
<i data-feather="copy" class="w-4 h-4 mr-2"></i>
Copy Prompt
</button>
</div>
<!-- JSON Prompt Card -->
<div class="prompt-card bg-white p-6 rounded-xl shadow-md">
<div class="flex items-center mb-4">
<i data-feather="code" class="w-6 h-6 text-purple-500 mr-2"></i>
<h3 class="text-xl font-semibold text-gray-800">JSON Metadata</h3>
</div>
<div class="bg-gray-50 p-4 rounded-lg overflow-x-auto">
<pre class="text-gray-800 whitespace-pre-wrap font-mono text-sm">{
"scene": "serene landscape at sunset",
"elements": {
"main_subject": "calm lake",
"secondary_elements": ["pine trees", "wooden dock", "red canoe"],
"foreground": "dock with canoe",
"background": "sky and trees"
},
"lighting": {
"type": "golden hour",
"quality": "warm and soft",
"direction": "side lighting"
},
"composition": {
"style": "cinematic",
"depth_of_field": "shallow",
"focal_length": "50mm"
},
"technical": {
"camera": "professional DSLR",
"lens": "50mm prime",
"aperture": "f/1.8",
"iso": "100",
"shutter_speed": "1/200s"
},
"mood": "peaceful, serene, nostalgic",
"color_palette": ["golden", "orange", "green", "blue"]
}</pre>
</div>
<button class="mt-4 gradient-bg text-white px-4 py-2 rounded-lg hover:opacity-90 transition flex items-center">
<i data-feather="copy" class="w-4 h-4 mr-2"></i>
Copy JSON
</button>
</div>
</div>
</div>
</section>
<!-- Footer -->
<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">
<i data-feather="camera" class="w-6 h-6 mr-2"></i>
<span class="text-xl font-bold">Prompt Analyzer Pro</span>
</div>
<p class="text-gray-400 mt-2">Extracting perfection from every pixel.</p>
</div>
<div class="flex space-x-6">
<a href="#" class="text-gray-400 hover:text-white">
<i data-feather="github"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white">
<i data-feather="twitter"></i>
</a>
<a href="#" class="text-gray-400 hover:text-white">
<i data-feather="linkedin"></i>
</a>
</div>
</div>
<div class="border-t border-gray-700 mt-8 pt-8 text-center text-gray-400">
<p>© 2023 Prompt Analyzer Pro. All rights reserved.</p>
</div>
</div>
</footer>
<script>
// Initialize feather icons
feather.replace();
// Dropzone functionality
const dropzone = document.getElementById('dropzone');
const fileInput = document.getElementById('fileInput');
dropzone.addEventListener('click', () => {
fileInput.click();
});
['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
dropzone.addEventListener(eventName, preventDefaults, false);
});
function preventDefaults(e) {
e.preventDefault();
e.stopPropagation();
}
['dragenter', 'dragover'].forEach(eventName => {
dropzone.addEventListener(eventName, highlight, false);
});
['dragleave', 'drop'].forEach(eventName => {
dropzone.addEventListener(eventName, unhighlight, false);
});
function highlight() {
dropzone.classList.add('dropzone-active');
}
function unhighlight() {
dropzone.classList.remove('dropzone-active');
}
dropzone.addEventListener('drop', handleDrop, false);
function handleDrop(e) {
const dt = e.dataTransfer;
const files = dt.files;
handleFiles(files);
}
fileInput.addEventListener('change', function() {
handleFiles(this.files);
});
function handleFiles(files) {
if (files.length) {
const file = files[0];
if (file.type.match('image.*')) {
// Here you would process the file
console.log('Image file selected:', file.name);
// In a real app, you would upload and process the image here
} else {
alert('Please select an image file.');
}
}
}
// URL input handling
const urlInput = document.getElementById('urlInput');
urlInput.addEventListener('keypress', function(e) {
if (e.key === 'Enter') {
const url = this.value.trim();
if (url) {
if (isValidHttpUrl(url)) {
console.log('Processing URL:', url);
// In a real app, you would fetch and process the image from URL here
} else {
alert('Please enter a valid HTTP/HTTPS URL');
}
}
}
});
function isValidHttpUrl(string) {
try {
const url = new URL(string);
return url.protocol === "http:" || url.protocol === "https:";
} catch (_) {
return false;
}
}
</script>
</body>
</html>
|