Skip to content
TheChatArchiveThe Chat Archive
gpt-4.1-mini-2025-04-14· OpenAIHugging Face LMArena Human Preference 140K

I need you to develop food delivery website using HTML + Tailwind CSS(cdn mode) +…

  1. User

    I need you to develop food delivery website using HTML + Tailwind CSS(cdn mode) + javascript with Glassmorphism style. Please note:

    • It should be responsive
    • It should have animation and transition effects for hover, colors and loading
    • It should have sidebar for responsive(mobile)
    • It should have dark theme

    Please note i need it in one single file(index.html)

  2. Assistant

    Certainly! Below is a complete single-file index.html for a food delivery website using HTML + Tailwind CSS (CDN) + JavaScript with:

    • Glassmorphism style
    • Responsive design
    • Sidebar for mobile
    • Dark theme
    • Animations and transitions on hover, colors, and loading

    <!DOCTYPE html>
    <html lang="en" class="scroll-smooth" data-theme="dark">
    <head>
      <meta charset="UTF-8" />
      <meta name="viewport" content="width=device-width, initial-scale=1" />
      <title>Glassmorphism Food Delivery</title>
      <!-- Tailwind CSS CDN -->
      <script src="https://cdn.tailwindcss.com"></script>
      <style>
        /* Glassmorphism background */
        .glass {
          background: rgba(255 255 255 / 0.1);
          backdrop-filter: blur(15px);
          -webkit-backdrop-filter: blur(15px);
          border-radius: 1rem;
          border: 1px solid rgba(255 255 255 / 0.2);
          box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
          transition: background-color 0.3s ease, border-color 0.3s ease;
        }
    
        /* Loading spinner */
        .loader {
          border: 4px solid rgba(255, 255, 255, 0.2);
          border-top: 4px solid #4ade80; /* green-400 */
          border-radius: 50%;
          width: 36px;
          height: 36px;
          animation: spin 1s linear infinite;
          margin: auto;
        }
        @keyframes spin {
          0% { transform: rotate(0deg);}
          100% { transform: rotate(360deg);}
        }
    
        /* Sidebar slide animation */
        .sidebar-enter {
          transform: translateX(-100%);
          transition: transform 0.3s ease;
        }
        .sidebar-enter-active {
          transform: translateX(0);
        }
        .sidebar-leave {
          transform: translateX(0);
          transition: transform 0.3s ease;
        }
        .sidebar-leave-active {
          transform: translateX(-100%);
        }
      </style>
    </head>
    <body class="bg-gradient-to-tr from-gray-900 via-gray-800 to-gray-900 text-white min-h-screen flex flex-col">
    
      <!-- Header -->
      <header class="flex items-center justify-between p-4 glass fixed top-0 left-0 right-0 z-50">
        <button id="menu-btn" aria-label="Open menu" class="md:hidden focus:outline-none">
          <svg class="w-8 h-8 text-green-400 hover:text-green-300 transition-colors" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24">
            <line x1="3" y1="12" x2="21" y2="12" />
            <line x1="3" y1="6" x2="21" y2="6" />
            <line x1="3" y1="18" x2="21" y2="18" />
          </svg>
        </button>
        <h1 class="text-2xl font-extrabold tracking-wide select-none">GlassFood</h1>
        <button id="theme-toggle" aria-label="Toggle dark/light theme" class="focus:outline-none">
          <svg id="theme-icon" class="w-7 h-7 text-green-400 hover:text-green-300 transition-colors" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" viewBox="0 0 24 24">
            <!-- Moon icon by default -->
            <path d="M21 12.79A9 9 0 1111.21 3a7 7 0 009.79 9.79z" />
          </svg>
        </button>
      </header>
    
      <!-- Sidebar for mobile -->
      <aside id="sidebar" class="fixed top-0 left-0 h-full w-64 bg-gray-900 bg-opacity-80 glass transform -translate-x-full md:hidden z-40 shadow-lg transition-transform duration-300 ease-in-out">
        <nav class="flex flex-col p-6 space-y-6 mt-16">
          <a href="#" class="text-green-400 font-semibold hover:text-green-300 transition-colors">Home</a>
          <a href="#menu" class="text-green-400 font-semibold hover:text-green-300 transition-colors">Menu</a>
          <a href="#about" class="text-green-400 font-semibold hover:text-green-300 transition-colors">About</a>
          <a href="#contact" class="text-green-400 font-semibold hover:text-green-300 transition-colors">Contact</a>
        </nav>
      </aside>
    
      <!-- Overlay when sidebar open -->
      <div id="overlay" class="fixed inset-0 bg-black bg-opacity-50 hidden z-30"></div>
    
      <main class="flex-grow pt-20 px-4 md:px-12 max-w-7xl mx-auto">
    
        <!-- Hero Section -->
        <section class="glass p-8 rounded-2xl mb-12 max-w-4xl mx-auto text-center shadow-lg">
          <h2 class="text-4xl md:text-5xl font-extrabold mb-4 tracking-wide">Delicious Food Delivered To You</h2>
          <p class="text-green-300 mb-6 text-lg md:text-xl">Fresh, fast, and right at your doorstep. Explore our menu and order now!</p>
          <button id="order-btn" class="bg-green-400 hover:bg-green-500 transition-colors text-gray-900 font-bold py-3 px-8 rounded-full shadow-lg shadow-green-400/50 transform hover:scale-105 active:scale-95">
            Order Now
          </button>
        </section>
    
        <!-- Menu Section -->
        <section id="menu" class="mb-16">
          <h3 class="text-3xl font-bold mb-8 text-center tracking-wide">Our Menu</h3>
          <div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8">
            <!-- Food Card Template -->
            <article class="glass p-6 rounded-xl shadow-lg hover:shadow-green-400/50 transition-shadow duration-300 cursor-pointer transform hover:-translate-y-1">
              <img src="https://images.unsplash.com/photo-1600891964599-f61ba0e24092?auto=format&fit=crop&w=400&q=80" alt="Pizza" class="rounded-xl mb-4 w-full h-48 object-cover" />
              <h4 class="text-xl font-semibold mb-2">Margherita Pizza</h4>
              <p class="text-green-300 mb-4">Classic delight with fresh tomatoes, mozzarella & basil.</p>
              <div class="flex justify-between items-center">
                <span class="font-bold text-lg">$12.99</span>
                <button class="bg-green-400 hover:bg-green-500 transition-colors text-gray-900 font-semibold py-1.5 px-4 rounded-full shadow-md shadow-green-400/50 transform hover:scale-105 active:scale-95">
                  Add to Cart
                </button>
              </div>
            </article>
    
            <article class="glass p-6 rounded-xl shadow-lg hover:shadow-green-400/50 transition-shadow duration-300 cursor-pointer transform hover:-translate-y-1">
              <img src="https://images.unsplash.com/photo-1565299624946-b28f40a0ae38?auto=format&fit=crop&w=400&q=80" alt="Burger" class="rounded-xl mb-4 w-full h-48 object-cover" />
              <h4 class="text-xl font-semibold mb-2">Cheeseburger</h4>
              <p class="text-green-300 mb-4">Juicy beef patty with cheddar cheese, lettuce & tomato.</p>
              <div class="flex justify-between items-center">
                <span class="font-bold text-lg">$10.49</span>
                <button class="bg-green-400 hover:bg-green-500 transition-colors text-gray-900 font-semibold py-1.5 px-4 rounded-full shadow-md shadow-green-400/50 transform hover:scale-105 active:scale-95">
                  Add to Cart
                </button>
              </div>
            </article>
    
            <article class="glass p-6 rounded-xl shadow-lg hover:shadow-green-400/50 transition-shadow duration-300 cursor-pointer transform hover:-translate-y-1">
              <img src="https://images.unsplash.com/photo-1504674900247-0877df9cc836?auto=format&fit=crop&w=400&q=80" alt="Sushi" class="rounded-xl mb-4 w-full h-48 object-cover" />
              <h4 class="text-xl font-semibold mb-2">Sushi Platter</h4>
              <p class="text-green-300 mb-4">Fresh salmon, tuna, and avocado rolls with soy sauce.</p>
              <div class="flex justify-between items-center">
                <span class="font-bold text-lg">$18.99</span>
                <button class="bg-green-400 hover:bg-green-500 transition-colors text-gray-900 font-semibold py-1.5 px-4 rounded-full shadow-md shadow-green-400/50 transform hover:scale-105 active:scale-95">
                  Add to Cart
                </button>
              </div>
            </article>
    
            <!-- Add more items as needed -->
          </div>
        </section>
    
        <!-- About Section -->
        <section id="about" class="glass p-8 rounded-2xl max-w-4xl mx-auto mb-16 shadow-lg">
          <h3 class="text-3xl font-bold mb-6 text-center tracking-wide">About Us</h3>
          <p class="text-green-300 text-center max-w-xl mx-auto leading-relaxed">
            At GlassFood, we believe in delivering not just food, but an experience. Our meals are prepared fresh daily with the finest ingredients and delivered swiftly to your door. Whether you're craving comfort food or something exotic, we've got you covered.
          </p>
        </section>
    
        <!-- Contact Section -->
        <section id="contact" class="glass p-8 rounded-2xl max-w-4xl mx-auto mb-16 shadow-lg">
          <h3 class="text-3xl font-bold mb-6 text-center tracking-wide">Contact Us</h3>
          <form id="contact-form" class="max-w-md mx-auto space-y-6">
            <input type="text" name="name" placeholder="Your Name" required
              class="w-full p-3 rounded-lg bg-gray-800 bg-opacity-50 border border-green-400 text-white placeholder-green-300 focus:outline-none focus:ring-2 focus:ring-green-400 transition" />
            <input type="email" name="email" placeholder="Your Email" required
              class="w-full p-3 rounded-lg bg-gray-800 bg-opacity-50 border border-green-400 text-white placeholder-green-300 focus:outline-none focus:ring-2 focus:ring-green-400 transition" />
            <textarea name="message" rows="4" placeholder="Your Message" required
              class="w-full p-3 rounded-lg bg-gray-800 bg-opacity-50 border border-green-400 text-white placeholder-green-300 focus:outline-none focus:ring-2 focus:ring-green-400 transition"></textarea>
            <button type="submit" class="w-full bg-green-400 hover:bg-green-500 transition-colors text-gray-900 font-bold py-3 rounded-full shadow-lg shadow-green-400/50 transform hover:scale-105 active:scale-95">
              Send Message
            </button>
          </form>
          <p id="form-status" class="mt-4 text-center text-green-400 font-semibold"></p>
        </section>
    
      </main>
    
      <footer class="text-center p-6 text-green-400 bg-gray-900 bg-opacity-80 glass">
        &copy; 2025 GlassFood. All rights reserved.
      </footer>
    
      <script>
        // Sidebar toggle
        const menuBtn = document.getElementById('menu-btn');
        const sidebar = document.getElementById('sidebar');
        const overlay = document.getElementById('overlay');
    
        function openSidebar() {
          sidebar.classList.remove('-translate-x-full');
          overlay.classList.remove('hidden');
          document.body.style.overflow = 'hidden';
        }
        function closeSidebar() {
          sidebar.classList.add('-translate-x-full');
          overlay.classList.add('hidden');
          document.body.style.overflow = '';
        }
    
        menuBtn.addEventListener('click', openSidebar);
        overlay.addEventListener('click', closeSidebar);
    
        // Close sidebar on link click (mobile)
        sidebar.querySelectorAll('a').forEach(link => {
          link.addEventListener('click', closeSidebar);
        });
    
        // Dark theme toggle
        const themeToggleBtn = document.getElementById('theme-toggle');
        const themeIcon = document.getElementById('theme-icon');
    
        function setTheme(dark) {
          if (dark) {
            document.documentElement.classList.add('dark');
            document.body.classList.add('bg-gradient-to-tr', 'from-gray-900', 'via-gray-800', 'to-gray-900', 'text-white');
            themeIcon.innerHTML = `
              <path d="M21 12.79A9 9 0 1111.21 3a7 7 0 009.79 9.79z" /> <!-- Moon -->
            `;
            localStorage.setItem('theme', 'dark');
          } else {
            document.documentElement.classList.remove('dark');
            document.body.classList.remove('bg-gradient-to-tr', 'from-gray-900', 'via-gray-800', 'to-gray-900', 'text-white');
            document.body.classList.add('bg-gradient-to-tr', 'from-green-200', 'via-green-100', 'to-green-200', 'text-gray-900');
            themeIcon.innerHTML = `
              <circle cx="12" cy="12" r="5" stroke="currentColor" stroke-width="2" fill="none"/>
              <line x1="12" y1="1" x2="12" y2="3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="12" y1="21" x2="12" y2="23" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="18.36" y1="18.36" x2="19.78" y2="19.78" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="1" y1="12" x2="3" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="21" y1="12" x2="23" y2="12" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="4.22" y1="19.78" x2="5.64" y2="18.36" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
              <line x1="18.36" y1="5.64" x2="19.78" y2="4.22" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
            `; // Sun icon
            localStorage.setItem('theme', 'light');
          }
        }
    
        // Initialize theme based on localStorage or prefers-color-scheme
        const savedTheme = localStorage.getItem('theme');
        if (savedTheme === 'dark' || (!savedTheme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
          setTheme(true);
        } else {
          setTheme(false);
        }
    
        themeToggleBtn.addEventListener('click', () => {
          const isDark = document.documentElement.classList.contains('dark');
          setTheme(!isDark);
        });
    
        // Order button loading animation
        const orderBtn = document.getElementById('order-btn');
        orderBtn.addEventListener('click', () => {
          orderBtn.disabled = true;
          const originalText = orderBtn.textContent;
          orderBtn.innerHTML = `<div class="loader"></div>`;
          setTimeout(() => {
            orderBtn.innerHTML = originalText;
            orderBtn.disabled = false;
            alert('Order placed successfully! 🍕🍔🍣');
          }, 2000);
        });
    
        // Contact form submission simulation
        const contactForm = document.getElementById('contact-form');
        const formStatus = document.getElementById('form-status');
    
        contactForm.addEventListener('submit', e => {
          e.preventDefault();
          formStatus.textContent = '';
          const submitBtn = contactForm.querySelector('button[type="submit"]');
          submitBtn.disabled = true;
          submitBtn.innerHTML = `<div class="loader"></div>`;
    
          setTimeout(() => {
            submitBtn.disabled = false;
            submitBtn.textContent = 'Send Message';
            formStatus.textContent = 'Thank you for contacting us! We will get back to you soon.';
            contactForm.reset();
          }, 2500);
        });
      </script>
    </body>
    </html>
    

    Features included:

    • Glassmorphism: translucent backgrounds with blur and subtle borders.
    • Dark theme by default with toggle to light theme.
    • Responsive sidebar for mobile with smooth slide-in/out.
    • Smooth hover animations on buttons and cards.
    • Loading spinner animation on order button and contact form submit.
    • Tailwind CDN for easy styling.
    • Accessible buttons and semantic HTML.
    • Gradient background for a modern look.
    • Clean, minimal layout with hero, menu, about, and contact sections.

    How to use:

    • Save the above code as index.html.
    • Open in any modern browser.
    • Resize window to see responsive sidebar.
    • Click the theme toggle to switch between dark/light.
    • Click "Order Now" to see loading animation.
    • Submit the contact form to see simulated sending.

    If you want me to add more features or customize it further, just ask!