lightswind
Version:
A modern frontend library with pre-built Tailwind CSS components for building responsive and interactive user interfaces.
163 lines (145 loc) • 11 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Advanced Shopping Website Header</title>
<script src="https://cdn.tailwindcss.com"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/lightwind@3.0.0/src/lightswind.css">
</head>
<body class="bg-gray-100 dark:bg-gray-900 font-primarylw transition-colors duration-300">
<!-- Header Section -->
<div class="w-screen h-screen Z-50">
<header class="bg-white dark:bg-gray-800 shadow-md w-screen">
<div class="max-w-7xl mx-auto px-6 py-4 flex items-center justify-between">
<!-- Logo Section -->
<div class="flex items-center space-x-2">
<img src="https://lightswind.com/lighstwind-logo.png" alt="Logo" class="h-8 md:h-12">
<h1 class="text-xl md:text-2xl font-bold text-gray-800 dark:text-white hidden md:flex">LightShop
</h1>
</div>
<div class="flex gap-10">
<!-- Desktop Menu Section -->
<nav class="hidden md:flex space-x-6">
<a href="#"
class="text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">Home</a>
<a href="#products"
class="text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">Products</a>
<a href="#services"
class="text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">Services</a>
<a href="#about"
class="text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">About</a>
<a href="#contact"
class="text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">Contact</a>
</nav>
<!-- Icons Section (Cart, Wishlist, User) -->
<div class="flex items-center space-x-6 text-black dark:text-white">
<!-- Profile Icon -->
<button class="relative hidden md:flex">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
</svg>
</button>
<!-- cart Icon -->
<button class="relative">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M15.75 10.5V6a3.75 3.75 0 1 0-7.5 0v4.5m11.356-1.993 1.263 12c.07.665-.45 1.243-1.119 1.243H4.25a1.125 1.125 0 0 1-1.12-1.243l1.264-12A1.125 1.125 0 0 1 5.513 7.5h12.974c.576 0 1.059.435 1.119 1.007ZM8.625 10.5a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm7.5 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z" />
</svg>
</button>
<!-- Hamburger Icon for Mobile -->
<button class="md:hidden flex items-center" onclick="toggleMenu()">
<svg id="hamburger-icon" xmlns=" http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M3.75 6.75h16.5M3.75 12h16.5M12 17.25h8.25" />
</svg>
<!-- Close (X) Icon -->
<svg id="close-icon" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke="currentColor" class="w-6 h-6 text-gray-700 dark:text-white hidden">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M6 18L18 6M6 6l12 12" />
</svg>
</button>
</div>
</div>
</div>
</header>
<!-- Mobile Menu -->
<div id="navbar-menu"
class="flex items-center justify-center flex-col md:hidden bg-white dark:bg-gray-800 shadow-md absolute inset-0 top-16 left-0 right-0 hidden transition-all duration-500 ease-in-out">
<div class="flex flex-col items-start space-y-12 py-6 text-black dark:text-white">
<a href="#"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw min-w-[100px]">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="m2.25 12 8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25" />
</svg>
Home
</a>
<a href="#products"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z" />
</svg>
Products
</a>
<a href="#services"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M10.343 3.94c.09-.542.56-.94 1.11-.94h1.093c.55 0 1.02.398 1.11.94l.149.894c.07.424.384.764.78.93.398.164.855.142 1.205-.108l.737-.527a1.125 1.125 0 0 1 1.45.12l.773.774c.39.389.44 1.002.12 1.45l-.527.737c-.25.35-.272.806-.107 1.204.165.397.505.71.93.78l.893.15c.543.09.94.559.94 1.109v1.094c0 .55-.397 1.02-.94 1.11l-.894.149c-.424.07-.764.383-.929.78-.165.398-.143.854.107 1.204l.527.738c.32.447.269 1.06-.12 1.45l-.774.773a1.125 1.125 0 0 1-1.449.12l-.738-.527c-.35-.25-.806-.272-1.203-.107-.398.165-.71.505-.781.929l-.149.894c-.09.542-.56.94-1.11.94h-1.094c-.55 0-1.019-.398-1.11-.94l-.148-.894c-.071-.424-.384-.764-.781-.93-.398-.164-.854-.142-1.204.108l-.738.527c-.447.32-1.06.269-1.45-.12l-.773-.774a1.125 1.125 0 0 1-.12-1.45l.527-.737c.25-.35.272-.806.108-1.204-.165-.397-.506-.71-.93-.78l-.894-.15c-.542-.09-.94-.56-.94-1.109v-1.094c0-.55.398-1.02.94-1.11l.894-.149c.424-.07.765-.383.93-.78.165-.398.143-.854-.108-1.204l-.526-.738a1.125 1.125 0 0 1 .12-1.45l.773-.773a1.125 1.125 0 0 1 1.45-.12l.737.527c.35.25.807.272 1.204.107.397-.165.71-.505.78-.929l.15-.894Z" />
<path stroke-linecap="round" stroke-linejoin="round" d="M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
</svg>
Services
</a>
<a href="#about"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
</svg>
About
</a>
<a href="#contact"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z" />
</svg>
Contact
</a>
<!-- Profile Icon -->
<a href="#user"
class="flex items-center gap-2 text-gray-700 dark:text-gray-300 font-semibold hover:text-primarylw dark:hover:text-primarylw">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"
stroke="currentColor" class="size-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" />
</svg>
User
</a>
</div>
</div>
</div>
<script>
function toggleMenu() {
const menu = document.getElementById('navbar-menu');
const hamburger = document.getElementById('hamburger-icon');
const closeIcon = document.getElementById('close-icon');
menu.classList.toggle('hidden');
hamburger.classList.toggle('hidden');
closeIcon.classList.toggle('hidden');
}
</script>
</body>
</html>