Unlock every premium block and template with All-Access from $20 / 3 months, cancel anytime. Get All-Access
All blocks
Free Products

Shelfline Products

A products block extracted from the Shelfline template, available in Tailwind CSS.

0 105
Shelfline Products preview

Download Codebase

Commercial License

Free download · up to 5 blocks per day. Unlimited with All-Access

shelfline.html
<!DOCTYPE html>
<html lang="en">
<head>
  <script>
    window.FontAwesomeConfig = { autoReplaceSvg: 'nest' };
  </script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/js/all.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Shelfline Products | Tailwind CSS UI Block</title>
  <meta name="description" content="A products block extracted from the Shelfline template, available in Tailwind CSS.">
  <meta name="keywords" content="Shelfline, Tailwind CSS template, HTML website template, ecommerce template, online marketplace, multi-category store, electronics shop, deals countdown, responsive ecommerce design">
  <meta name="author" content="Let's templates">
  <link rel="canonical" href="">

  <meta property="og:type" content="product">
  <meta property="og:site_name" content="Let's templates">
  <meta property="og:locale" content="en_US">
  <meta property="og:url" content="">
  <meta property="og:title" content="Shelfline | Tailwind CSS Marketplace Ecommerce Template">
  <meta property="og:description" content="A fresh, green Tailwind CSS marketplace template for multi-category online stores selling electronics, gaming, fashion, books and beauty, with deal countdowns, category pages, product pages, and a cart.">
  <meta property="og:image" content="">
  <meta property="og:image:alt" content="Shelfline template preview">

  <meta name="twitter:card" content="summary_large_image">
  <meta name="twitter:url" content="">
  <meta name="twitter:title" content="Shelfline | Tailwind CSS Marketplace Ecommerce Template">
  <meta name="twitter:description" content="A fresh, green Tailwind CSS marketplace template for multi-category online stores selling electronics, gaming, fashion, books and beauty, with deal countdowns, category pages, product pages, and a cart.">
  <meta name="twitter:image" content="">
  <meta name="twitter:image:alt" content="Shelfline template preview">
  <script src="https://cdn.tailwindcss.com/3.4.17"></script>
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
  <link rel="preconnect" href="https://fonts.googleapis.com">
  <link href="https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,300;0,400;0,700;0,900;1,700;1,900&amp;display=swap" rel="stylesheet">
  <script>
    tailwind.config = {
      theme: {
        extend: {
          colors: {
            forest: '#115e3b',
            leaf: '#22c55e',
            mint: '#dcfce7',
            smoke: '#f4f4f4',
            deal: '#ef3b3b'
          },
          fontFamily: {
            sans: ['Lato', 'ui-sans-serif', 'system-ui', 'sans-serif']
          }
        }
      }
    };
  </script>
  <style>
    @view-transition { navigation: auto; }
    ::view-transition-old(root) { animation: 180ms ease-out both page-fade-out; }
    ::view-transition-new(root) { animation: 220ms ease-in both page-fade-in; }
    @keyframes page-fade-out { to { opacity: 0; } }
    @keyframes page-fade-in { from { opacity: 0; } }
    html { scroll-behavior: smooth; }
    [hidden] { display: none !important; }
    .no-scrollbar { scrollbar-width: none; }
    .no-scrollbar::-webkit-scrollbar { display: none; }
    .btn-leaf { background: radial-gradient(circle at 35% 30%, #86efac, #22c55e 60%, #16a34a); }
    .marquee-track { animation: marquee 30s linear infinite; }
    .marquee:hover .marquee-track { animation-play-state: paused; }
    @keyframes marquee { to { transform: translateX(-50%); } }
    [data-hero-slide] { transition: opacity .6s ease; }
    [data-trend] [data-trend-card] { flex: 1 1 0; min-width: 0; }
    [data-trend] [data-trend-card][data-expanded="true"] { flex-grow: 2.2; }
    [data-trend] [data-trend-info], [data-trend] [data-trend-buy] { opacity: 0; transition: opacity .3s ease; }
    [data-trend] [data-trend-card][data-expanded="true"] [data-trend-info], [data-trend] [data-trend-card][data-expanded="true"] [data-trend-buy] { opacity: 1; }
    [data-trend] [data-trend-card][data-expanded="true"] [data-trend-go] { display: none; }
    [data-trend] [data-trend-card]:not([data-expanded="true"]) [data-trend-buy] { display: none; }
    @media (max-width: 767px) {
      [data-trend] { overflow-x: auto; scroll-snap-type: x mandatory; }
      [data-trend] [data-trend-card] { flex: 0 0 70%; scroll-snap-align: start; }
      [data-trend] [data-trend-info], [data-trend] [data-trend-buy] { opacity: 1; }
    }
    .reveal-ready [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; transition-delay: var(--reveal-delay, 0ms); }
    .reveal-ready [data-reveal].is-visible { opacity: 1; transform: none; }
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
      .marquee-track { animation: none; }
      [data-hero-slide] { transition: none; }
      ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
    }
  </style>
</head>
<body class="bg-white font-sans text-neutral-900 antialiased overflow-x-hidden">
<!-- block:start products -->
    <section id="for-you" class="pt-20" data-grid>
      <div class="flex items-center justify-between gap-4">
        <h2 class="text-3xl font-bold md:text-4xl">Picked for you</h2>
        <a href="electronics.html" class="inline-flex shrink-0 items-center gap-2 text-lg text-forest hover:underline">See all products <i class="fa-solid fa-chevron-right text-sm"></i></a>
      </div>
      <div class="mt-8 grid gap-5 sm:grid-cols-2 lg:grid-cols-4">
          <article data-grid-item data-category="electronics" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="pulse-portable-speaker.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1547052178-7f2c5a20c332?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Grey fabric portable speaker with a wrist strap on a white surface" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-26%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Pulse Portable Speaker"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="pulse-portable-speaker.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Pulse Portable Speaker"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="pulse-portable-speaker.html" class="hover:text-forest">Pulse Portable Speaker</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Electronics</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$89.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$119.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Pulse Portable Speaker to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="electronics" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="aura-mini-smart-speaker.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1586078875290-c22eb791ad5d?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Compact white smart speaker on a pale background" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-24%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Aura Mini Smart Speaker"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="aura-mini-smart-speaker.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Aura Mini Smart Speaker"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="aura-mini-smart-speaker.html" class="hover:text-forest">Aura Mini Smart Speaker</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Electronics</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$99.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$129.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Aura Mini Smart Speaker to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="movies-tv" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="lumen-home-projector.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1535016120720-40c646be5580?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Home projector beaming light in a dark red room" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-22%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Lumen Home Projector"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="lumen-home-projector.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Lumen Home Projector"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="lumen-home-projector.html" class="hover:text-forest">Lumen Home Projector</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Movies &amp; TV</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$329.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$419.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Lumen Home Projector to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="electronics" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="halo-studio-headphones.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1700087151960-178ea946e608?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="White and black over-ear headphones on a peach background" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-26%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Halo Studio Headphones"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="halo-studio-headphones.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Halo Studio Headphones"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="halo-studio-headphones.html" class="hover:text-forest">Halo Studio Headphones</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Electronics</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$149.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$199.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Halo Studio Headphones to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="electronics" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="nova-x-ultra-phone.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1727941035071-910fd07135bb?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Dark smartphone lying face down showing its camera bar" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-18%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Nova X Ultra 12GB+256GB"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="nova-x-ultra-phone.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Nova X Ultra 12GB+256GB"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="nova-x-ultra-phone.html" class="hover:text-forest">Nova X Ultra 12GB+256GB</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Electronics</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$699.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$849.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Nova X Ultra 12GB+256GB to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="gaming" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="keyline-mechanical-keyboard.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1618384887929-16ec33fab9ef?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Compact black mechanical keyboard with orange accent keys on marble" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-22%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Keyline Mechanical Keyboard"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="keyline-mechanical-keyboard.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Keyline Mechanical Keyboard"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="keyline-mechanical-keyboard.html" class="hover:text-forest">Keyline Mechanical Keyboard</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Video Games</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$109.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$139.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Keyline Mechanical Keyboard to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="toys-collection" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="cuddle-teddy-bear.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1556012018-50c5c0da73bf?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Soft brown teddy bear with a red bow" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-26%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Cuddle Teddy Bear"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="cuddle-teddy-bear.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Cuddle Teddy Bear"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="cuddle-teddy-bear.html" class="hover:text-forest">Cuddle Teddy Bear</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Toys &amp; Collection</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$29.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$39.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Cuddle Teddy Bear to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
          <article data-grid-item data-category="gaming" class="group rounded-3xl bg-smoke p-2" >
            <div class="relative overflow-hidden rounded-2xl">
              <a href="raid-gaming-headset.html" class="block aspect-[4/3.6]"><img src="https://images.unsplash.com/photo-1610041321327-b794c052db27?auto=format&amp;fit=crop&amp;w=700&amp;q=80" alt="Black and red wired gaming headset on a desk" loading="lazy" class="h-full w-full object-cover transition duration-500 group-hover:scale-105"></a>
              <span class="absolute left-3 top-3 rounded-lg bg-deal px-2.5 py-1 text-xs font-bold text-white">-25%</span>
              <div class="absolute right-3 top-3 flex flex-col gap-2">
                <button type="button" data-wish aria-pressed="false" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-deal shadow" aria-label="Save Raid Gaming Headset"><i class="fa-regular fa-heart" data-wish-icon></i></button>
                <a href="raid-gaming-headset.html" class="inline-flex h-9 w-9 items-center justify-center rounded-full bg-white text-neutral-700 shadow" aria-label="Quick view Raid Gaming Headset"><i class="fa-regular fa-eye text-sm"></i></a>
              </div>
            </div>
            <div class="mt-2 rounded-2xl bg-white p-4">
              <h3 class="font-bold leading-snug"><a href="raid-gaming-headset.html" class="hover:text-forest">Raid Gaming Headset</a></h3>
              <p class="mt-1 text-xs text-neutral-500">Video Games</p>
              <div class="mt-3 flex items-center justify-between">
                <p><span class="text-xl font-bold text-forest">$79.00</span> <s class="ml-1 border-l border-neutral-300 pl-2 text-sm text-neutral-500">$105.00</s></p>
                <button type="button" data-add-cart class="btn-leaf inline-flex h-10 w-10 items-center justify-center rounded-full text-white shadow" aria-label="Add Raid Gaming Headset to cart"><i class="fa-solid fa-cart-shopping text-sm"></i></button>
              </div>
            </div>
          </article>
      </div>
    </section>
    <!-- block:end products -->
<script>
    document.querySelectorAll("[data-menu-toggle]").forEach((button) => {
      const menu = document.getElementById(button.getAttribute("aria-controls"));
      if (!menu) return;
      button.addEventListener("click", () => {
        const open = button.getAttribute("aria-expanded") === "true";
        button.setAttribute("aria-expanded", String(!open));
        menu.classList.toggle("hidden", open);
      });
    });

    (() => {
      const read = () => { try { return Number(localStorage.getItem("shelfline-cart") ?? 2); } catch (e) { return 2; } };
      const write = (value) => { try { localStorage.setItem("shelfline-cart", String(value)); } catch (e) {} };
      const paint = () => document.querySelectorAll("[data-cart-count]").forEach((el) => { el.textContent = read(); });
      window.shelflineCart = { read, write, paint };
      paint();
      document.addEventListener("click", (event) => {
        const add = event.target.closest("[data-add-cart]");
        if (add) {
          write(read() + 1);
          paint();
          add.animate([{ transform: "scale(1)" }, { transform: "scale(1.15)" }, { transform: "scale(1)" }], { duration: 300 });
        }
        const wish = event.target.closest("[data-wish]");
        if (wish) {
          const saved = wish.getAttribute("aria-pressed") !== "true";
          wish.setAttribute("aria-pressed", String(saved));
          const icon = wish.querySelector("[data-wish-icon]");
          if (icon) { icon.classList.toggle("fa-solid", saved); icon.classList.toggle("fa-regular", !saved); }
        }
      });
    })();

    document.querySelectorAll("[data-hero]").forEach((hero) => {
      const slides = [...hero.querySelectorAll("[data-hero-slide]")];
      const dots = [...hero.querySelectorAll("[data-hero-dot]")];
      let index = 0;
      let timer;
      const show = (next) => {
        index = (next + slides.length) % slides.length;
        slides.forEach((slide, i) => {
          slide.classList.toggle("opacity-0", i !== index);
          slide.classList.toggle("pointer-events-none", i !== index);
          slide.setAttribute("aria-hidden", String(i !== index));
        });
        dots.forEach((dot, i) => dot.setAttribute("aria-current", String(i === index)));
      };
      const start = () => {
        if (navigator.webdriver || matchMedia("(prefers-reduced-motion: reduce)").matches) return;
        clearInterval(timer);
        timer = setInterval(() => show(index + 1), 6000);
      };
      dots.forEach((dot, i) => dot.addEventListener("click", () => { show(i); start(); }));
      hero.addEventListener("mouseenter", () => clearInterval(timer));
      hero.addEventListener("mouseleave", start);
      start();
    });

    document.querySelectorAll("[data-scroller]").forEach((scroller) => {
      const track = scroller.querySelector("[data-scroll-track]");
      const step = () => (track.firstElementChild?.offsetWidth || 200) + 18;
      scroller.querySelector("[data-scroll-prev]")?.addEventListener("click", () => track.scrollBy({ left: -step() * 2 }));
      scroller.querySelector("[data-scroll-next]")?.addEventListener("click", () => {
        if (track.scrollLeft >= track.scrollWidth - track.clientWidth - 4) return track.scrollTo({ left: 0 });
        track.scrollBy({ left: step() * 2 });
      });
    });

    document.querySelectorAll("[data-trend-section]").forEach((section) => {
      const cards = [...section.querySelectorAll("[data-trend-card]")];
      const tabs = [...section.querySelectorAll("[data-trend-tab]")];
      const expand = (card) => cards.forEach((other) => { other.dataset.expanded = String(other === card); });
      const filter = (value) => {
        tabs.forEach((tab) => tab.setAttribute("aria-selected", String(tab.dataset.trendTab === value)));
        const visible = cards.filter((card) => card.dataset.category === value || (value === "fashion" && card.dataset.category === "winter"));
        const shown = (visible.length >= 2 ? visible : cards).slice(0, 5);
        cards.forEach((card) => { card.hidden = !shown.includes(card); });
        expand(shown[Math.min(1, shown.length - 1)]);
      };
      tabs.forEach((tab) => tab.addEventListener("click", () => filter(tab.dataset.trendTab)));
      cards.forEach((card) => {
        card.addEventListener("mouseenter", () => { if (matchMedia("(hover: hover)").matches) expand(card); });
        card.addEventListener("focusin", () => expand(card));
      });
      filter(tabs[0]?.dataset.trendTab || "fashion");
    });

    document.querySelectorAll("[data-grid]").forEach((grid) => {
      const tabs = [...grid.querySelectorAll("[data-grid-tab]")];
      if (!tabs.length) return;
      const items = [...grid.querySelectorAll("[data-grid-item]")];
      tabs.forEach((tab) => tab.addEventListener("click", () => {
        const value = tab.dataset.gridTab;
        tabs.forEach((other) => other.setAttribute("aria-selected", String(other === tab)));
        let shown = 0;
        items.forEach((item) => {
          const match = value === "all" || item.dataset.category === value;
          item.hidden = !(match && shown < 8);
          if (match && shown < 8) shown += 1;
        });
      }));
    });

    document.querySelectorAll("[data-countdown]").forEach((box) => {
      if (navigator.webdriver) return;
      const end = Date.now() + Number(box.dataset.hours || 48) * 3600 * 1000;
      const units = { days: 86400, hours: 3600, mins: 60, secs: 1 };
      const tick = () => {
        let left = Math.max(0, Math.floor((end - Date.now()) / 1000));
        Object.entries(units).forEach(([key, size]) => {
          const el = box.querySelector(`[data-unit="${key}"]`);
          if (el) el.textContent = String(Math.floor(left / size)).padStart(2, "0");
          left %= size;
        });
      };
      tick();
      setInterval(tick, 1000);
    });

    document.querySelectorAll("[data-accordion]").forEach((accordion) => {
      const items = [...accordion.querySelectorAll("[data-accordion-item]")];
      items.forEach((item) => {
        const button = item.querySelector("[data-accordion-button]");
        const panel = document.getElementById(button.getAttribute("aria-controls"));
        button.addEventListener("click", () => {
          const open = button.getAttribute("aria-expanded") !== "true";
          items.forEach((other) => {
            const otherButton = other.querySelector("[data-accordion-button]");
            const isTarget = other === item && open;
            otherButton.setAttribute("aria-expanded", String(isTarget));
            other.setAttribute("aria-expanded", String(isTarget));
            document.getElementById(otherButton.getAttribute("aria-controls")).hidden = !isTarget;
          });
        });
      });
    });

    document.querySelectorAll("[data-newsletter]").forEach((form) => {
      form.addEventListener("submit", (event) => {
        event.preventDefault();
        const note = form.parentElement.querySelector("[data-newsletter-note]");
        if (note) note.hidden = false;
        form.reset();
      });
    });

    (() => {
      const items = document.querySelectorAll("[data-reveal]");
      const skip = navigator.webdriver || !("IntersectionObserver" in window) || matchMedia("(prefers-reduced-motion: reduce)").matches;
      if (!items.length || skip) return;
      document.documentElement.classList.add("reveal-ready");
      const observer = new IntersectionObserver((entries) => {
        entries.forEach((entry) => {
          if (!entry.isIntersecting) return;
          entry.target.classList.add("is-visible");
          observer.unobserve(entry.target);
        });
      }, { rootMargin: "0px 0px -10% 0px" });
      items.forEach((item) => observer.observe(item));
    })();
  </script>
<!-- Optional credit — delete this block if you prefer a clean footer -->
<p class="lt-built-with" style="margin:0;padding:12px 16px;text-align:center;font:500 11px/1.4 system-ui,-apple-system,sans-serif;color:#9ca3af;">Built with <a href="https://letstemplates.com" style="color:#059669;text-decoration:none;">Let's templates</a></p>
</body>
</html>

From this template

Shelfline screenshot Premium

E-commerce

Shelfline

Unlimited access to all products

Unlock the entire library of premium templates and blocks. Renews automatically, cancel anytime.

$20 / 3 months or $60 / year
Get Unlimited Access