build image search platform homepage. The application must be pixel-perfect, responsive, and scalable, supporting over 10 million monthly active users globally. accessibility standards (WCAG 2.1 AA) 1. **Layout** : - **Hero** : Contains the logo, search bar, and login button. - **Search Bar** : Supports drag-and-drop functionality and includes a camera icon for image uploads. - **Popular Searches** : Displays trending search terms horizontally. - **Feature Cards** : Grid layout with cards for features like "Image creation," "Image Editing," etc. - **Image Gallery** : Displays a masonry grid of images with hover effects and captions. Use https://picsum.photos/ for image holder - Initial Deployment
92033c2 verified | <html lang="en" class="scroll-smooth"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>PixSearch - Find & Create Stunning Images</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> | |
| /* Custom styles for masonry layout and accessibility */ | |
| .masonry { | |
| column-count: 1; | |
| column-gap: 1rem; | |
| } | |
| @media (min-width: 640px) { | |
| .masonry { | |
| column-count: 2; | |
| } | |
| } | |
| @media (min-width: 768px) { | |
| .masonry { | |
| column-count: 3; | |
| } | |
| } | |
| @media (min-width: 1024px) { | |
| .masonry { | |
| column-count: 4; | |
| } | |
| } | |
| .masonry-item { | |
| break-inside: avoid; | |
| margin-bottom: 1rem; | |
| } | |
| .search-drop-zone { | |
| border: 2px dashed #e5e7eb; | |
| transition: all 0.3s ease; | |
| } | |
| .search-drop-zone.active { | |
| border-color: #3b82f6; | |
| background-color: #eff6ff; | |
| } | |
| /* Focus styles for accessibility */ | |
| *:focus-visible { | |
| outline: 2px solid #3b82f6; | |
| outline-offset: 2px; | |
| } | |
| /* Skip to content link for screen readers */ | |
| .skip-link { | |
| position: absolute; | |
| left: -9999px; | |
| top: 0; | |
| background: #000; | |
| color: white; | |
| padding: 0.5rem; | |
| z-index: 100; | |
| } | |
| .skip-link:focus { | |
| left: 0; | |
| } | |
| /* Image hover effect */ | |
| .image-card { | |
| transition: transform 0.3s ease, box-shadow 0.3s ease; | |
| } | |
| .image-card:hover { | |
| transform: translateY(-4px); | |
| box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05); | |
| } | |
| .image-overlay { | |
| opacity: 0; | |
| transition: opacity 0.3s ease; | |
| } | |
| .image-card:hover .image-overlay { | |
| opacity: 1; | |
| } | |
| </style> | |
| </head> | |
| <body class="bg-gray-50 text-gray-900 font-sans antialiased"> | |
| <!-- Skip to content link for accessibility --> | |
| <a href="#main-content" class="skip-link">Skip to main content</a> | |
| <!-- Header/Navigation --> | |
| <header class="sticky top-0 z-50 bg-white shadow-sm"> | |
| <div class="container mx-auto px-4 py-3 flex items-center justify-between"> | |
| <div class="flex items-center space-x-8"> | |
| <a href="#" class="flex items-center" aria-label="PixSearch Home"> | |
| <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="#3b82f6" class="w-8 h-8"> | |
| <path fill-rule="evenodd" d="M1.5 6a2.25 2.25 0 012.25-2.25h16.5A2.25 2.25 0 0122.5 6v12a2.25 2.25 0 01-2.25 2.25H3.75A2.25 2.25 0 011.5 18V6zM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0021 18v-1.94l-2.69-2.689a1.5 1.5 0 00-2.12 0l-.88.879.97.97a.75.75 0 11-1.06 1.06l-5.16-5.159a1.5 1.5 0 00-2.12 0L3 16.061zm10.125-7.81a1.125 1.125 0 112.25 0 1.125 1.125 0 01-2.25 0z" clip-rule="evenodd" /> | |
| </svg> | |
| <span class="ml-2 text-xl font-bold text-blue-600">PixSearch</span> | |
| </a> | |
| <nav class="hidden md:flex space-x-6"> | |
| <a href="#" class="text-gray-700 hover:text-blue-600 transition">Explore</a> | |
| <a href="#" class="text-gray-700 hover:text-blue-600 transition">Collections</a> | |
| <a href="#" class="text-gray-700 hover:text-blue-600 transition">Community</a> | |
| </nav> | |
| </div> | |
| <div class="flex items-center space-x-4"> | |
| <button aria-label="Toggle dark mode" class="p-2 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-moon text-gray-600"></i> | |
| </button> | |
| <button class="hidden md:block px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"> | |
| Sign in | |
| </button> | |
| <button aria-label="Menu" class="md:hidden p-2 rounded-full hover:bg-gray-100"> | |
| <i class="fas fa-bars text-gray-600"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </header> | |
| <main id="main-content"> | |
| <!-- Hero Section --> | |
| <section class="py-12 md:py-20 bg-gradient-to-b from-blue-50 to-white"> | |
| <div class="container mx-auto px-4"> | |
| <div class="max-w-3xl mx-auto text-center"> | |
| <h1 class="text-4xl md:text-5xl font-bold text-gray-900 mb-6"> | |
| Discover over 100 million high-quality images | |
| </h1> | |
| <p class="text-xl text-gray-600 mb-8"> | |
| Find the perfect image for your next project. Free to use, no attribution required. | |
| </p> | |
| <!-- Search Bar with Drag & Drop --> | |
| <div class="max-w-2xl mx-auto mb-12"> | |
| <div id="searchDropZone" class="search-drop-zone relative rounded-full bg-white shadow-md border border-gray-200 flex items-center px-6 py-3"> | |
| <input | |
| type="text" | |
| placeholder="Search for images..." | |
| class="flex-grow outline-none bg-transparent pr-4" | |
| aria-label="Search for images" | |
| > | |
| <div class="flex items-center space-x-3"> | |
| <button | |
| id="uploadBtn" | |
| class="p-2 rounded-full hover:bg-gray-100 text-gray-600" | |
| aria-label="Upload image" | |
| > | |
| <i class="fas fa-camera"></i> | |
| </button> | |
| <button | |
| class="px-4 py-2 bg-blue-600 text-white rounded-full hover:bg-blue-700 transition" | |
| aria-label="Search" | |
| > | |
| <i class="fas fa-search"></i> | |
| <span class="ml-2 hidden md:inline">Search</span> | |
| </button> | |
| </div> | |
| <div id="dropMessage" class="absolute inset-0 bg-blue-50 bg-opacity-90 flex items-center justify-center rounded-full pointer-events-none opacity-0 transition"> | |
| <div class="text-center p-4"> | |
| <i class="fas fa-cloud-upload-alt text-blue-600 text-3xl mb-2"></i> | |
| <p class="font-medium text-blue-600">Drop your image here to search</p> | |
| </div> | |
| </div> | |
| </div> | |
| <input type="file" id="fileInput" class="hidden" accept="image/*"> | |
| <p class="text-sm text-gray-500 mt-3"> | |
| Try: <span class="font-medium">nature</span>, <span class="font-medium">wallpaper</span>, <span class="font-medium">food</span>, <span class="font-medium">business</span> | |
| </p> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Popular Searches --> | |
| <section class="py-8 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-xl font-semibold text-gray-800 mb-4">Popular searches</h2> | |
| <div class="flex flex-wrap gap-3"> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Nature</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Wallpaper</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Background</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Food</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Business</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Travel</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Art</a> | |
| <a href="#" class="px-4 py-2 bg-gray-100 hover:bg-gray-200 rounded-full text-gray-800 transition">Technology</a> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Feature Cards --> | |
| <section class="py-12 bg-gray-50"> | |
| <div class="container mx-auto px-4"> | |
| <h2 class="text-2xl font-bold text-gray-900 mb-8 text-center">Create something amazing</h2> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6"> | |
| <div class="bg-white rounded-xl shadow-sm overflow-hidden hover:shadow-md transition"> | |
| <div class="h-40 bg-gradient-to-r from-purple-500 to-pink-500 flex items-center justify-center"> | |
| <i class="fas fa-magic text-white text-5xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-lg font-semibold mb-2">AI Image Creation</h3> | |
| <p class="text-gray-600">Generate unique images with AI based on your description.</p> | |
| <button class="mt-4 text-blue-600 font-medium hover:text-blue-700 transition">Try now</button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm overflow-hidden hover:shadow-md transition"> | |
| <div class="h-40 bg-gradient-to-r from-blue-500 to-teal-400 flex items-center justify-center"> | |
| <i class="fas fa-edit text-white text-5xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-lg font-semibold mb-2">Image Editing</h3> | |
| <p class="text-gray-600">Powerful online editor to enhance and modify your images.</p> | |
| <button class="mt-4 text-blue-600 font-medium hover:text-blue-700 transition">Edit now</button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm overflow-hidden hover:shadow-md transition"> | |
| <div class="h-40 bg-gradient-to-r from-orange-500 to-yellow-400 flex items-center justify-center"> | |
| <i class="fas fa-palette text-white text-5xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-lg font-semibold mb-2">Color Palette</h3> | |
| <p class="text-gray-600">Extract color palettes from images for your designs.</p> | |
| <button class="mt-4 text-blue-600 font-medium hover:text-blue-700 transition">Explore</button> | |
| </div> | |
| </div> | |
| <div class="bg-white rounded-xl shadow-sm overflow-hidden hover:shadow-md transition"> | |
| <div class="h-40 bg-gradient-to-r from-green-500 to-emerald-400 flex items-center justify-center"> | |
| <i class="fas fa-layer-group text-white text-5xl"></i> | |
| </div> | |
| <div class="p-6"> | |
| <h3 class="text-lg font-semibold mb-2">Background Removal</h3> | |
| <p class="text-gray-600">Instantly remove backgrounds from your images.</p> | |
| <button class="mt-4 text-blue-600 font-medium hover:text-blue-700 transition">Remove now</button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- Image Gallery --> | |
| <section class="py-12 bg-white"> | |
| <div class="container mx-auto px-4"> | |
| <div class="flex justify-between items-center mb-8"> | |
| <h2 class="text-2xl font-bold text-gray-900">Trending images</h2> | |
| <a href="#" class="text-blue-600 hover:text-blue-700 font-medium transition">View all</a> | |
| </div> | |
| <div class="masonry"> | |
| <!-- Masonry grid of images --> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/800?random=1" | |
| alt="Beautiful mountain landscape with sunset" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Mountain Sunset</h3> | |
| <p class="text-gray-300 text-sm">Nature • 4K</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/600?random=2" | |
| alt="Modern city skyline at night" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">City Lights</h3> | |
| <p class="text-gray-300 text-sm">Urban • HD</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/700?random=3" | |
| alt="Delicious pasta dish with fresh ingredients" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Gourmet Pasta</h3> | |
| <p class="text-gray-300 text-sm">Food • 4K</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/900?random=4" | |
| alt="Person hiking in beautiful forest" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Forest Hike</h3> | |
| <p class="text-gray-300 text-sm">Adventure • HD</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/500?random=5" | |
| alt="Abstract colorful geometric shapes" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Abstract Art</h3> | |
| <p class="text-gray-300 text-sm">Art • 4K</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/750?random=6" | |
| alt="Tropical beach with crystal clear water" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Tropical Paradise</h3> | |
| <p class="text-gray-300 text-sm">Travel • 4K</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/650?random=7" | |
| alt="Modern workspace with laptop and coffee" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Workspace</h3> | |
| <p class="text-gray-300 text-sm">Business • HD</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="masonry-item"> | |
| <div class="image-card relative rounded-lg overflow-hidden mb-4"> | |
| <img | |
| src="https://picsum.photos/600/850?random=8" | |
| alt="Close-up of a cute puppy" | |
| class="w-full h-auto object-cover" | |
| loading="lazy" | |
| > | |
| <div class="image-overlay absolute inset-0 bg-gradient-to-t from-black/70 to-transparent flex flex-col justify-end p-4"> | |
| <div class="flex justify-between items-center"> | |
| <div> | |
| <h3 class="text-white font-medium">Golden Retriever</h3> | |
| <p class="text-gray-300 text-sm">Animals • 4K</p> | |
| </div> | |
| <button class="text-white hover:text-blue-300 transition" aria-label="Save image"> | |
| <i class="far fa-heart"></i> | |
| </button> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| </div> | |
| <div class="text-center mt-8"> | |
| <button class="px-6 py-3 bg-blue-600 text-white rounded-md hover:bg-blue-700 transition focus:ring-2 focus:ring-blue-500 focus:ring-offset-2"> | |
| Load more images | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| <!-- CTA Section --> | |
| <section class="py-16 bg-blue-600 text-white"> | |
| <div class="container mx-auto px-4 text-center"> | |
| <h2 class="text-3xl font-bold mb-4">Ready to find your perfect image?</h2> | |
| <p class="text-xl mb-8 max-w-2xl mx-auto">Join millions of creators who trust PixSearch for their image needs.</p> | |
| <div class="flex flex-col sm:flex-row justify-center gap-4"> | |
| <button class="px-6 py-3 bg-white text-blue-600 rounded-md hover:bg-gray-100 transition font-medium"> | |
| Start searching now | |
| </button> | |
| <button class="px-6 py-3 border border-white rounded-md hover:bg-blue-700 transition font-medium"> | |
| Learn more | |
| </button> | |
| </div> | |
| </div> | |
| </section> | |
| </main> | |
| <!-- Footer --> | |
| <footer class="bg-gray-900 text-gray-300 py-12"> | |
| <div class="container mx-auto px-4"> | |
| <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-8"> | |
| <div> | |
| <h3 class="text-white font-bold text-lg mb-4">PixSearch</h3> | |
| <p class="mb-4">The internet's source for freely usable images. Powered by creators everywhere.</p> | |
| <div class="flex space-x-4"> | |
| <a href="#" aria-label="Twitter" class="hover:text-white transition"><i class="fab fa-twitter"></i></a> | |
| <a href="#" aria-label="Facebook" class="hover:text-white transition"><i class="fab fa-facebook"></i></a> | |
| <a href="#" aria-label="Instagram" class="hover:text-white transition"><i class="fab fa-instagram"></i></a> | |
| <a href="#" aria-label="Pinterest" class="hover:text-white transition"><i class="fab fa-pinterest"></i></a> | |
| </div> | |
| </div> | |
| <div> | |
| <h3 class="text-white font-bold text-lg mb-4">Company</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="hover:text-white transition">About</a></li> | |
| <li><a href="#" class="hover:text-white transition">Careers</a></li> | |
| <li><a href="#" class="hover:text-white transition">Blog</a></li> | |
| <li><a href="#" class="hover:text-white transition">Press</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="text-white font-bold text-lg mb-4">Resources</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="hover:text-white transition">Help Center</a></li> | |
| <li><a href="#" class="hover:text-white transition">Licensing</a></li> | |
| <li><a href="#" class="hover:text-white transition">API</a></li> | |
| <li><a href="#" class="hover:text-white transition">Contributors</a></li> | |
| </ul> | |
| </div> | |
| <div> | |
| <h3 class="text-white font-bold text-lg mb-4">Legal</h3> | |
| <ul class="space-y-2"> | |
| <li><a href="#" class="hover:text-white transition">Terms</a></li> | |
| <li><a href="#" class="hover:text-white transition">Privacy</a></li> | |
| <li><a href="#" class="hover:text-white transition">Cookies</a></li> | |
| <li><a href="#" class="hover:text-white transition">Guidelines</a></li> | |
| </ul> | |
| </div> | |
| </div> | |
| <div class="border-t border-gray-800 mt-12 pt-8 flex flex-col md:flex-row justify-between items-center"> | |
| <p>© 2023 PixSearch. All rights reserved.</p> | |
| <div class="mt-4 md:mt-0"> | |
| <a href="#" class="hover:text-white transition">Privacy Policy</a> | |
| <span class="mx-2">•</span> | |
| <a href="#" class="hover:text-white transition">Terms of Service</a> | |
| </div> | |
| </div> | |
| </div> | |
| </footer> | |
| <script> | |
| // Drag and drop functionality for search | |
| const searchDropZone = document.getElementById('searchDropZone'); | |
| const dropMessage = document.getElementById('dropMessage'); | |
| const uploadBtn = document.getElementById('uploadBtn'); | |
| const fileInput = document.getElementById('fileInput'); | |
| // Handle drag events | |
| ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => { | |
| searchDropZone.addEventListener(eventName, preventDefaults, false); | |
| }); | |
| function preventDefaults(e) { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| } | |
| ['dragenter', 'dragover'].forEach(eventName => { | |
| searchDropZone.addEventListener(eventName, highlight, false); | |
| }); | |
| ['dragleave', 'drop'].forEach(eventName => { | |
| searchDropZone.addEventListener(eventName, unhighlight, false); | |
| }); | |
| function highlight() { | |
| searchDropZone.classList.add('active'); | |
| dropMessage.classList.remove('opacity-0'); | |
| } | |
| function unhighlight() { | |
| searchDropZone.classList.remove('active'); | |
| dropMessage.classList.add('opacity-0'); | |
| } | |
| // Handle dropped files | |
| searchDropZone.addEventListener('drop', handleDrop, false); | |
| function handleDrop(e) { | |
| const dt = e.dataTransfer; | |
| const files = dt.files; | |
| handleFiles(files); | |
| } | |
| // Handle file input click | |
| uploadBtn.addEventListener('click', () => { | |
| fileInput.click(); | |
| }); | |
| fileInput.addEventListener('change', function() { | |
| if (this.files.length) { | |
| handleFiles(this.files); | |
| } | |
| }); | |
| function handleFiles(files) { | |
| const file = files[0]; | |
| if (file.type.match('image.*')) { | |
| // In a real app, you would upload the file and perform a reverse image search | |
| alert(`Image "${file.name}" selected for search. In a real app, this would trigger an image search.`); | |
| } else { | |
| alert('Please select an image file.'); | |
| } | |
| } | |
| // Mobile menu toggle (would be expanded in a real app) | |
| document.querySelector('.md\\:hidden').addEventListener('click', function() { | |
| alert('Mobile menu would open here in a complete implementation.'); | |
| }); | |
| // Dark mode toggle | |
| document.querySelector('[aria-label="Toggle dark mode"]').addEventListener('click', function() { | |
| document.documentElement.classList.toggle('dark'); | |
| const icon = this.querySelector('i'); | |
| if (document.documentElement.classList.contains('dark')) { | |
| icon.classList.replace('fa-moon', 'fa-sun'); | |
| document.body.classList.add('bg-gray-900', 'text-gray-100'); | |
| document.body.classList.remove('bg-gray-50', 'text-gray-900'); | |
| } else { | |
| icon.classList.replace('fa-sun', 'fa-moon'); | |
| document.body.classList.remove('bg-gray-900', 'text-gray-100'); | |
| document.body.classList.add('bg-gray-50', 'text-gray-900'); | |
| } | |
| }); | |
| </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=block/pixel" style="color: #fff;text-decoration: underline;" target="_blank" >Remix</a></p></body> | |
| </html> |