initial commit, cuz im getting lost in this
This commit is contained in:
@@ -0,0 +1 @@
|
||||
compiled.js
|
||||
@@ -0,0 +1 @@
|
||||
^[\s\S]*$
|
||||
@@ -0,0 +1,3 @@
|
||||
original_template:
|
||||
default_styles:
|
||||
disable: true
|
||||
@@ -0,0 +1 @@
|
||||
#header
|
||||
@@ -0,0 +1,62 @@
|
||||
(() => {
|
||||
const header = document.querySelector("#header");
|
||||
|
||||
// Extract Logo
|
||||
const logoEl = header.querySelector(".vc-headerlogo img");
|
||||
const logo = {
|
||||
src: logoEl ? logoEl.src : '',
|
||||
alt: logoEl ? logoEl.alt : '',
|
||||
};
|
||||
|
||||
const customContentBlock = header.querySelector(".custom-content-block.custom-content-header-1 > .content");
|
||||
const customContentHeader = customContentBlock ? customContentBlock.innerHTML : '';
|
||||
|
||||
function extractMenuTree(ulElement) {
|
||||
if (!ulElement) return [];
|
||||
|
||||
const listItems = Array.from(ulElement.children).filter(el => el.tagName === 'LI');
|
||||
|
||||
return listItems.map(li => {
|
||||
const link = li.querySelector(":scope > a");
|
||||
|
||||
const itemData = {
|
||||
text: link ? link.textContent.trim() : '',
|
||||
href: link ? link.href : ''
|
||||
};
|
||||
|
||||
const subMenu = li.querySelector(":scope > ul[role='menu']");
|
||||
if (subMenu) {
|
||||
itemData.sublinks = extractMenuTree(subMenu);
|
||||
}
|
||||
|
||||
return itemData;
|
||||
});
|
||||
}
|
||||
|
||||
const rootMenu = header.querySelector("#menu #menucategories nav ul[role='menu']");
|
||||
const menuData = extractMenuTree(rootMenu);
|
||||
|
||||
const menuTop = header.querySelector("#menutop ul[role='menu']");
|
||||
const menuTopLinks = menuTop.querySelectorAll("li > a");
|
||||
const menuTopData = Array.from(menuTopLinks).map(link => ({
|
||||
text: link.textContent.trim(),
|
||||
href: link.href
|
||||
}));
|
||||
|
||||
const itemCountBasket = parseInt(header.querySelector("#basketinfo .vc-basketinfoextended-numberofitems").textContent) || 0;
|
||||
|
||||
const basket = {
|
||||
itemCount: itemCountBasket,
|
||||
link: header.querySelector("#basketinfo .vc-basketinfoextended-header").href || '/kosik'
|
||||
}
|
||||
|
||||
return {
|
||||
logo,
|
||||
customContentHeader,
|
||||
menu: {
|
||||
top: menuTopData,
|
||||
main: menuData
|
||||
},
|
||||
basket,
|
||||
};
|
||||
})();
|
||||
@@ -0,0 +1,792 @@
|
||||
<header class="site-header">
|
||||
<!-- Top bar (bg-primary) -->
|
||||
<div class="top-bar text-sm">
|
||||
<div class="container top-bar-inner">
|
||||
<div class="top-bar-left">{{{customContentHeader}}}</div>
|
||||
<nav class="top-bar-right">
|
||||
{{#each menu.top}}
|
||||
<a href="{{this.href}}">{{this.text}}</a>
|
||||
{{/each}}
|
||||
</nav>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main Header -->
|
||||
<div class="container">
|
||||
<div class="main-header">
|
||||
<!-- Logo -->
|
||||
<a href="/" class="logo">
|
||||
{{#if logo.src}}
|
||||
<img src="{{logo.src}}" alt="{{logo.alt}}" class="logo-img" />
|
||||
{{else}}
|
||||
<div class="logo-icon text-lg font-bold">C</div>
|
||||
<span class="logo-text text-xl font-bold tracking-tight">colors</span>
|
||||
{{/if}}
|
||||
</a>
|
||||
|
||||
<!-- Desktop Navigation -->
|
||||
<nav class="desktop-nav">
|
||||
{{#each menu.main}}
|
||||
<div class="nav-item text-sm font-medium uppercase tracking-wide">
|
||||
<a href="{{this.href}}" class="nav-link">
|
||||
{{this.text}} {{#if this.sublinks}}
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="nav-icon"
|
||||
>
|
||||
<path d="m6 9 6 6 6-6" />
|
||||
</svg>
|
||||
{{/if}}
|
||||
</a>
|
||||
|
||||
<!-- First level dropdown -->
|
||||
{{#if this.sublinks}}
|
||||
<div class="dropdown">
|
||||
<div class="dropdown-inner">
|
||||
{{#each this.sublinks}}
|
||||
<div class="dropdown-item">
|
||||
<a href="{{this.href}}" class="dropdown-link text-sm">
|
||||
{{this.text}} {{#if this.sublinks}}
|
||||
<!-- Removed nav-icon class so it no longer accidentally flips on top-level hover -->
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
style="width: 1rem; height: 1rem"
|
||||
>
|
||||
<path d="m9 18 6-6-6-6" />
|
||||
</svg>
|
||||
{{/if}}
|
||||
</a>
|
||||
|
||||
<!-- Second level dropdown -->
|
||||
{{#if this.sublinks}}
|
||||
<div class="sub-dropdown">
|
||||
<div class="dropdown-inner">
|
||||
{{#each this.sublinks}}
|
||||
<!-- Applying dropdown-link here fixes the hover issue -->
|
||||
<a href="{{this.href}}" class="dropdown-link text-sm">
|
||||
{{this.text}}
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</nav>
|
||||
|
||||
<!-- Actions -->
|
||||
<div class="actions">
|
||||
<button id="search-toggle" class="action-btn" aria-label="Vyhledávání">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="11" cy="11" r="8" />
|
||||
<path d="m21 21-4.3-4.3" />
|
||||
</svg>
|
||||
</button>
|
||||
<a href="#" class="action-btn desktop-user">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" />
|
||||
<circle cx="12" cy="7" r="4" />
|
||||
</svg>
|
||||
</a>
|
||||
<a href="{{basket.link}}" class="action-btn cart-wrapper">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<circle cx="8" cy="21" r="1" />
|
||||
<circle cx="19" cy="21" r="1" />
|
||||
<path
|
||||
d="M2.05 2.05h2l2.66 12.42a2 2 0 0 0 2 1.58h9.78a2 2 0 0 0 1.95-1.57l1.65-7.43H5.12"
|
||||
/>
|
||||
</svg>
|
||||
<span class="cart-badge text-xs font-bold">{{basket.itemCount}}</span>
|
||||
</a>
|
||||
<button
|
||||
id="mobile-menu-toggle"
|
||||
class="action-btn mobile-menu-btn"
|
||||
aria-label="Menu"
|
||||
>
|
||||
<svg
|
||||
id="menu-icon-open"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="4" x2="20" y1="12" y2="12" />
|
||||
<line x1="4" x2="20" y1="6" y2="6" />
|
||||
<line x1="4" x2="20" y1="18" y2="18" />
|
||||
</svg>
|
||||
<svg
|
||||
id="menu-icon-close"
|
||||
class="hidden"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<line x1="18" y1="6" x2="6" y2="18"></line>
|
||||
<line x1="6" y1="6" x2="18" y2="18"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Search Bar (Slide down) -->
|
||||
<div id="search-bar" class="search-container hidden">
|
||||
<div class="search-input-wrapper">
|
||||
<input
|
||||
type="search"
|
||||
placeholder="Hledat produkty..."
|
||||
class="search-input"
|
||||
/>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
class="search-icon"
|
||||
>
|
||||
<circle cx="11" cy="11" r="8" />
|
||||
<path d="m21 21-4.3-4.3" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Mobile Menu (Slide down) -->
|
||||
<div id="mobile-menu" class="mobile-menu hidden">
|
||||
<nav class="container mobile-nav-inner">
|
||||
{{#each menu.main}}
|
||||
<div class="mobile-item-wrap">
|
||||
<div class="mobile-item-header">
|
||||
<a href="{{this.href}}" class="mobile-link font-medium">
|
||||
{{this.text}}
|
||||
</a>
|
||||
{{#if this.sublinks}}
|
||||
<button class="mobile-toggle js-submenu-toggle">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m6 9 6 6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
{{#if this.sublinks}}
|
||||
<div class="mobile-sub-menu hidden">
|
||||
{{#each this.sublinks}}
|
||||
<div class="mobile-item-wrap">
|
||||
<div class="mobile-item-header">
|
||||
<a href="{{this.href}}" class="mobile-link text-sm">
|
||||
{{this.text}}
|
||||
</a>
|
||||
</div>
|
||||
{{#if this.sublinks}}
|
||||
<!-- Auto-expand 3rd level on mobile to match React setup structure -->
|
||||
<div
|
||||
class="mobile-sub-menu"
|
||||
style="
|
||||
display: block;
|
||||
border-color: transparent;
|
||||
margin-top: 0;
|
||||
padding-top: 0;
|
||||
"
|
||||
>
|
||||
{{#each this.sublinks}}
|
||||
<div class="mobile-item-header">
|
||||
<a
|
||||
href="{{this.href}}"
|
||||
class="mobile-link text-sm"
|
||||
style="color: var(--muted-foreground)"
|
||||
>
|
||||
{{this.text}}
|
||||
</a>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/each}}
|
||||
|
||||
<!-- Top bar data fallback on mobile -->
|
||||
<div class="mobile-contact">{{{customContentHeader}}}</div>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&display=swap");
|
||||
|
||||
:root {
|
||||
/* Exact provided variables (Light Mode Only) */
|
||||
--background: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--card-foreground: oklch(0.145 0 0);
|
||||
--popover: oklch(1 0 0);
|
||||
--popover-foreground: oklch(0.145 0 0);
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--secondary-foreground: oklch(0.205 0 0);
|
||||
--muted: oklch(0.97 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--destructive: oklch(0.577 0.245 27.325);
|
||||
--destructive-foreground: oklch(0.577 0.245 27.325);
|
||||
--border: oklch(0.922 0 0);
|
||||
--input: oklch(0.922 0 0);
|
||||
--ring: oklch(0.708 0 0);
|
||||
|
||||
/* Layout Variables */
|
||||
--font-sans:
|
||||
"Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
|
||||
--max-w-7xl: 80rem; /* 1280px */
|
||||
--h-16: 4rem; /* 64px */
|
||||
--h-20: 5rem; /* 80px */
|
||||
--w-10: 2.5rem; /* 40px */
|
||||
--h-10: 2.5rem; /* 40px */
|
||||
}
|
||||
|
||||
/* Reset & Base Setup */
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
body {
|
||||
background-color: var(--background);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.site-header {
|
||||
font-family: var(--font-sans);
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 50;
|
||||
background-color: var(--card);
|
||||
border-bottom: 1px solid var(--border);
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.site-header a,
|
||||
.site-header button {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
/* Container bounds mapping exactly to max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 */
|
||||
.container {
|
||||
max-width: var(--max-w-7xl);
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.container {
|
||||
padding: 0 1.5rem;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.container {
|
||||
padding: 0 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Utilities */
|
||||
.text-xs {
|
||||
font-size: 0.75rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
.text-sm {
|
||||
font-size: 0.875rem;
|
||||
line-height: 1.25rem;
|
||||
}
|
||||
.text-base {
|
||||
font-size: 1rem;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
.text-lg {
|
||||
font-size: 1.125rem;
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
.text-xl {
|
||||
font-size: 1.25rem;
|
||||
line-height: 1.75rem;
|
||||
}
|
||||
.font-medium {
|
||||
font-weight: 500;
|
||||
}
|
||||
.font-bold {
|
||||
font-weight: 700;
|
||||
}
|
||||
.uppercase {
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.tracking-wide {
|
||||
letter-spacing: 0.025em;
|
||||
}
|
||||
.tracking-tight {
|
||||
letter-spacing: -0.025em;
|
||||
}
|
||||
.hidden {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* ------------------ Top Bar ------------------ */
|
||||
.top-bar {
|
||||
background-color: var(--primary);
|
||||
color: var(--primary-foreground);
|
||||
padding: 0.5rem 0; /* py-2 */
|
||||
}
|
||||
.top-bar-inner {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.top-bar-left,
|
||||
.top-bar-right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1.5rem; /* gap-6 */
|
||||
}
|
||||
.top-bar-left a,
|
||||
.top-bar-right a {
|
||||
transition: opacity 0.2s;
|
||||
}
|
||||
.top-bar-left a:hover,
|
||||
.top-bar-right a:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.top-bar-left {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.top-bar-left {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
/* ------------------ Main Header ------------------ */
|
||||
.main-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: var(--h-16);
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.main-header {
|
||||
height: var(--h-20);
|
||||
}
|
||||
}
|
||||
|
||||
/* Logo */
|
||||
.logo {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem; /* gap-2 */
|
||||
}
|
||||
.logo-img {
|
||||
height: var(--h-10);
|
||||
width: auto;
|
||||
}
|
||||
.logo-icon {
|
||||
width: var(--w-10);
|
||||
height: var(--h-10);
|
||||
border-radius: 9999px;
|
||||
background: linear-gradient(
|
||||
to bottom right,
|
||||
var(--accent),
|
||||
color-mix(in srgb, var(--accent) 70%, transparent)
|
||||
);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: var(--accent-foreground);
|
||||
}
|
||||
.logo-text {
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
/* ------------------ Desktop Nav ------------------ */
|
||||
.desktop-nav {
|
||||
display: none;
|
||||
align-items: center;
|
||||
gap: 2rem; /* gap-8 */
|
||||
height: 100%;
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.desktop-nav {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
|
||||
.nav-item {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.nav-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.25rem; /* gap-1 */
|
||||
padding: 0.5rem 0; /* py-2 */
|
||||
color: var(--foreground);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.nav-link:hover {
|
||||
color: var(--accent-foreground);
|
||||
}
|
||||
|
||||
.nav-icon {
|
||||
width: 1rem;
|
||||
height: 1rem; /* w-4 h-4 */
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
/* ONLY rotate the chevron inside the top-level link, not the nested ones */
|
||||
.nav-item:hover > .nav-link .nav-icon {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
/* Dropdowns */
|
||||
.dropdown {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
padding-top: 0.5rem; /* pt-2 */
|
||||
z-index: 50;
|
||||
}
|
||||
.nav-item:hover .dropdown {
|
||||
display: block;
|
||||
}
|
||||
|
||||
.dropdown-inner {
|
||||
background-color: var(--card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow:
|
||||
0 10px 15px -3px rgba(0, 0, 0, 0.1),
|
||||
0 4px 6px -4px rgba(0, 0, 0, 0.1);
|
||||
min-width: 200px;
|
||||
padding: 0.5rem 0; /* py-2 */
|
||||
}
|
||||
|
||||
.dropdown-item {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dropdown-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0.625rem 1rem; /* px-4 py-2.5 */
|
||||
color: var(--foreground);
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
/* Apply hover effect directly to the link, and keep it active when hovering a child dropdown */
|
||||
.dropdown-link:hover,
|
||||
.dropdown-item:hover > .dropdown-link {
|
||||
background-color: var(--secondary);
|
||||
color: var(--accent-foreground);
|
||||
}
|
||||
|
||||
/* Sub-Dropdowns */
|
||||
.sub-dropdown {
|
||||
display: none;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 100%;
|
||||
padding-left: 0.5rem; /* pl-2 */
|
||||
z-index: 50;
|
||||
}
|
||||
.dropdown-item:hover .sub-dropdown {
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* ------------------ Actions ------------------ */
|
||||
.actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 1rem; /* gap-4 */
|
||||
}
|
||||
.action-btn {
|
||||
padding: 0.5rem; /* p-2 */
|
||||
border-radius: 9999px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
color: var(--foreground);
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background-color 0.2s;
|
||||
}
|
||||
.action-btn:hover {
|
||||
background-color: var(--secondary);
|
||||
}
|
||||
.action-btn svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem; /* w-5 h-5 */
|
||||
}
|
||||
|
||||
.desktop-user {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.desktop-user {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
.mobile-menu-btn {
|
||||
display: flex;
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.mobile-menu-btn {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.cart-badge {
|
||||
position: absolute;
|
||||
top: -0.25rem;
|
||||
right: -0.25rem; /* -top-1 -right-1 */
|
||||
width: 1.25rem;
|
||||
height: 1.25rem; /* w-5 h-5 */
|
||||
background-color: var(--accent);
|
||||
color: var(--accent-foreground);
|
||||
border-radius: 9999px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
/* ------------------ Search Bar ------------------ */
|
||||
.search-container {
|
||||
padding-bottom: 1rem; /* pb-4 */
|
||||
animation: slideDown 0.2s ease-out;
|
||||
}
|
||||
.search-input-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
.search-input {
|
||||
width: 100%;
|
||||
padding: 0.75rem 1rem 0.75rem 3rem; /* px-4 py-3 pl-12 */
|
||||
background-color: var(--secondary);
|
||||
border: 1px solid transparent;
|
||||
border-radius: 0.5rem; /* rounded-lg */
|
||||
color: var(--foreground);
|
||||
outline: none;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
.search-input::placeholder {
|
||||
color: var(--muted-foreground);
|
||||
}
|
||||
.search-input:focus {
|
||||
box-shadow: 0 0 0 2px var(--ring);
|
||||
}
|
||||
.search-icon {
|
||||
position: absolute;
|
||||
left: 1rem;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
color: var(--muted-foreground);
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
|
||||
/* ------------------ Mobile Menu ------------------ */
|
||||
.mobile-menu {
|
||||
border-top: 1px solid var(--border);
|
||||
animation: slideDown 0.2s ease-out;
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.mobile-menu {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
.mobile-nav-inner {
|
||||
padding: 1rem 0; /* py-4 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.25rem; /* space-y-1 */
|
||||
}
|
||||
.mobile-item-wrap {
|
||||
position: relative;
|
||||
}
|
||||
.mobile-item-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.mobile-link {
|
||||
flex: 1;
|
||||
padding: 0.5rem 0; /* py-2 */
|
||||
color: var(--foreground);
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.mobile-link:hover {
|
||||
color: var(--accent-foreground);
|
||||
}
|
||||
|
||||
.mobile-toggle {
|
||||
padding: 0.5rem;
|
||||
border: none;
|
||||
background: transparent;
|
||||
border-radius: 9999px;
|
||||
color: var(--foreground);
|
||||
}
|
||||
.mobile-toggle:hover {
|
||||
background-color: var(--secondary);
|
||||
}
|
||||
.mobile-toggle svg {
|
||||
width: 1rem;
|
||||
height: 1rem;
|
||||
transition: transform 0.2s;
|
||||
}
|
||||
.mobile-toggle.active svg {
|
||||
transform: rotate(180deg);
|
||||
}
|
||||
|
||||
.mobile-sub-menu {
|
||||
border-left: 2px solid var(--border);
|
||||
margin-left: 0.5rem; /* ml-2 */
|
||||
padding-left: 1rem; /* pl-4 */
|
||||
}
|
||||
|
||||
.mobile-contact {
|
||||
padding-top: 1rem; /* pt-4 */
|
||||
margin-top: 0.5rem;
|
||||
border-top: 1px solid var(--border);
|
||||
color: var(--muted-foreground);
|
||||
font-size: 0.875rem;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.mobile-contact {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes slideDown {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(-0.5rem);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
// 1. Search Bar Toggle
|
||||
const searchBtn = document.getElementById("search-toggle");
|
||||
const searchBar = document.getElementById("search-bar");
|
||||
|
||||
if (searchBtn && searchBar) {
|
||||
searchBtn.addEventListener("click", () => {
|
||||
searchBar.classList.toggle("hidden");
|
||||
if (!searchBar.classList.contains("hidden")) {
|
||||
searchBar.querySelector("input").focus();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 2. Mobile Menu Toggle
|
||||
const mobileBtn = document.getElementById("mobile-menu-toggle");
|
||||
const mobileMenu = document.getElementById("mobile-menu");
|
||||
const iconOpen = document.getElementById("menu-icon-open");
|
||||
const iconClose = document.getElementById("menu-icon-close");
|
||||
|
||||
if (mobileBtn && mobileMenu) {
|
||||
mobileBtn.addEventListener("click", () => {
|
||||
mobileMenu.classList.toggle("hidden");
|
||||
iconOpen.classList.toggle("hidden");
|
||||
iconClose.classList.toggle("hidden");
|
||||
});
|
||||
}
|
||||
|
||||
// 3. Mobile Sub-Menu Toggles
|
||||
const submenuToggles = document.querySelectorAll(".js-submenu-toggle");
|
||||
submenuToggles.forEach((toggle) => {
|
||||
toggle.addEventListener("click", (e) => {
|
||||
// Toggle rotation class on button
|
||||
toggle.classList.toggle("active");
|
||||
// Find the sibling submenu div and toggle hidden class
|
||||
const submenu = toggle.parentElement.nextElementSibling;
|
||||
if (submenu && submenu.classList.contains("mobile-sub-menu")) {
|
||||
submenu.classList.toggle("hidden");
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</header>
|
||||
@@ -0,0 +1 @@
|
||||
^/$
|
||||
@@ -0,0 +1,6 @@
|
||||
#AjaxMainSection {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 1.5rem;
|
||||
padding-top: 1.5rem;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
main#main #AjaxMainSection section.section_top_after
|
||||
@@ -0,0 +1,20 @@
|
||||
(() => {
|
||||
const main = document.querySelector("main#main #AjaxMainSection section.section_top_after .content");
|
||||
|
||||
const items = main.querySelectorAll("ul > li");
|
||||
|
||||
const data = Array.from(items).map((item) => {
|
||||
const image = item.querySelector("img").src;
|
||||
const alt = item.querySelector("img").getAttribute("title");
|
||||
|
||||
const content = item.querySelector("div").innerHTML;
|
||||
|
||||
return {
|
||||
image,
|
||||
alt,
|
||||
content,
|
||||
};
|
||||
});
|
||||
|
||||
return data;
|
||||
})();
|
||||
@@ -0,0 +1,140 @@
|
||||
:root {
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--accent-foreground: oklch(0.205 0 0);
|
||||
--font-sans: 'Geist', 'Geist Fallback', ui-sans-serif, system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.promo-cards-section {
|
||||
font-family: var(--font-sans);
|
||||
padding: 3rem 0; /* py-12 */
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.promo-cards-section { padding: 4rem 0; /* lg:py-16 */ }
|
||||
}
|
||||
|
||||
.promo-container {
|
||||
max-width: 80rem; /* max-w-7xl */
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem; /* px-4 */
|
||||
}
|
||||
@media (min-width: 640px) { .promo-container { padding: 0 1.5rem; /* sm:px-6 */ } }
|
||||
@media (min-width: 1024px) { .promo-container { padding: 0 2rem; /* lg:px-8 */ } }
|
||||
|
||||
.promo-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr;
|
||||
gap: 1rem; /* gap-4 */
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.promo-grid {
|
||||
grid-template-columns: repeat(3, 1fr); /* md:grid-cols-3 */
|
||||
gap: 1.5rem; /* md:gap-6 */
|
||||
}
|
||||
}
|
||||
|
||||
.promo-card {
|
||||
position: relative;
|
||||
aspect-ratio: 3 / 2;
|
||||
border-radius: 0.75rem; /* rounded-xl */
|
||||
overflow: hidden;
|
||||
display: block;
|
||||
text-decoration: none;
|
||||
/* Acts as 'group' class */
|
||||
}
|
||||
|
||||
.promo-card-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.promo-card:hover .promo-card-img {
|
||||
transform: scale(1.05); /* group-hover:scale-105 */
|
||||
}
|
||||
|
||||
.promo-card-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
background: linear-gradient(to top, color-mix(in srgb, var(--primary) 80%, transparent), transparent);
|
||||
pointer-events: none;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.promo-card-content {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
padding: 1.5rem; /* p-6 */
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
/*
|
||||
* RESET INJECTED HTML LAYOUT
|
||||
* Overriding classes like .w-45, .fl-right, .h-100 to force the React layout
|
||||
*/
|
||||
.promo-card-content > div {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: center !important;
|
||||
justify-content: flex-end !important;
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
float: none !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
/*
|
||||
* STYLE INJECTED HEADINGS
|
||||
* Overriding inline styles like style="line-height: 1.6em;"
|
||||
*/
|
||||
.promo-card-content h1,
|
||||
.promo-card-content h2,
|
||||
.promo-card-content h3 {
|
||||
font-size: 1.125rem !important; /* text-lg */
|
||||
font-weight: 700 !important; /* font-bold */
|
||||
color: var(--primary-foreground) !important;
|
||||
margin: 0 0 1rem 0 !important; /* mb-4 */
|
||||
line-height: 1.2 !important;
|
||||
text-align: center !important;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.promo-card-content h1,
|
||||
.promo-card-content h2,
|
||||
.promo-card-content h3 {
|
||||
font-size: 1.25rem !important; /* md:text-xl */
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* STYLE INJECTED BUTTON
|
||||
* Targeting the .btn and .btn-primary classes
|
||||
*/
|
||||
.promo-card-content .btn {
|
||||
display: inline-flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
padding: 0.5rem 1.5rem !important; /* px-6 py-2 */
|
||||
background-color: var(--accent) !important;
|
||||
color: var(--accent-foreground) !important;
|
||||
border-radius: 0.5rem !important; /* rounded-lg */
|
||||
font-weight: 500 !important;
|
||||
font-size: 0.875rem !important; /* text-sm */
|
||||
text-decoration: none !important;
|
||||
transition: background-color 0.2s !important;
|
||||
margin: 0 auto !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
/* Hover effect on the button when hovering anywhere on the card */
|
||||
.promo-card:hover .promo-card-content .btn {
|
||||
background-color: color-mix(in srgb, var(--accent) 90%, transparent) !important; /* group-hover:bg-accent/90 */
|
||||
}
|
||||
|
||||
/* Reset spacing on injected wrapper divs like .pt-1 */
|
||||
.promo-card-content .pt-1,
|
||||
.promo-card-content .mt-1 {
|
||||
padding: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<section class="promo-cards-section">
|
||||
<div class="promo-container">
|
||||
<div class="promo-grid">
|
||||
{{#each this}}
|
||||
<div class="promo-card">
|
||||
<img
|
||||
src="{{this.image}}"
|
||||
alt="{{this.alt}}"
|
||||
class="promo-card-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="promo-card-overlay"></div>
|
||||
|
||||
<div class="promo-card-content">
|
||||
{{{this.content}}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,107 @@
|
||||
document.addEventListener("DOMContentLoaded", () => {
|
||||
const sliders = document.querySelectorAll(".js-slider-wrapper");
|
||||
|
||||
sliders.forEach((slider) => {
|
||||
const track = slider.querySelector(".js-slider-track");
|
||||
let slides = Array.from(track.querySelectorAll(".slide"));
|
||||
const prevBtn = slider.querySelector(".js-slider-prev");
|
||||
const nextBtn = slider.querySelector(".js-slider-next");
|
||||
const dotsContainer = slider.querySelector(".js-slider-dots");
|
||||
const dots = Array.from(slider.querySelectorAll(".slider-dot"));
|
||||
|
||||
if (slides.length <= 1) {
|
||||
if (prevBtn) prevBtn.style.display = "none";
|
||||
if (nextBtn) nextBtn.style.display = "none";
|
||||
if (dotsContainer) dotsContainer.style.display = "none";
|
||||
return;
|
||||
}
|
||||
|
||||
const firstClone = slides[0].cloneNode(true);
|
||||
const lastClone = slides[slides.length - 1].cloneNode(true);
|
||||
|
||||
track.appendChild(firstClone);
|
||||
track.insertBefore(lastClone, slides[0]);
|
||||
|
||||
const allSlides = track.querySelectorAll(".slide");
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
track.scrollTo({ left: track.clientWidth, behavior: "instant" });
|
||||
});
|
||||
|
||||
let scrollTimeout;
|
||||
track.addEventListener("scroll", () => {
|
||||
clearTimeout(scrollTimeout);
|
||||
|
||||
scrollTimeout = setTimeout(() => {
|
||||
const slideWidth = track.clientWidth;
|
||||
const scrollLeft = track.scrollLeft;
|
||||
|
||||
if (
|
||||
Math.abs(scrollLeft - slideWidth * (allSlides.length - 1)) < 5
|
||||
) {
|
||||
track.scrollTo({ left: slideWidth, behavior: "instant" });
|
||||
} else if (scrollLeft < 5) {
|
||||
track.scrollTo({
|
||||
left: slideWidth * (allSlides.length - 2),
|
||||
behavior: "instant",
|
||||
});
|
||||
}
|
||||
|
||||
let activeIndex = Math.round(track.scrollLeft / slideWidth) - 1;
|
||||
if (activeIndex < 0) activeIndex = dots.length - 1;
|
||||
if (activeIndex >= dots.length) activeIndex = 0;
|
||||
|
||||
dots.forEach((d) => d.classList.remove("active"));
|
||||
if (dots[activeIndex]) dots[activeIndex].classList.add("active");
|
||||
}, 50);
|
||||
});
|
||||
|
||||
window.addEventListener("resize", () => {
|
||||
const activeIndex =
|
||||
dots.findIndex((d) => d.classList.contains("active")) + 1;
|
||||
track.scrollTo({
|
||||
left: track.clientWidth * activeIndex,
|
||||
behavior: "instant",
|
||||
});
|
||||
});
|
||||
|
||||
if (nextBtn) {
|
||||
nextBtn.addEventListener("click", () => {
|
||||
track.scrollBy({ left: track.clientWidth, behavior: "smooth" });
|
||||
});
|
||||
}
|
||||
|
||||
if (prevBtn) {
|
||||
prevBtn.addEventListener("click", () => {
|
||||
track.scrollBy({ left: -track.clientWidth, behavior: "smooth" });
|
||||
});
|
||||
}
|
||||
|
||||
dots.forEach((dot, index) => {
|
||||
dot.addEventListener("click", () => {
|
||||
track.scrollTo({
|
||||
left: track.clientWidth * (index + 1),
|
||||
behavior: "smooth",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
let autoPlayTimer;
|
||||
const startAutoPlay = () => {
|
||||
clearInterval(autoPlayTimer);
|
||||
autoPlayTimer = setInterval(() => {
|
||||
if (slider.offsetWidth === 0) return;
|
||||
track.scrollBy({ left: track.clientWidth, behavior: "smooth" });
|
||||
}, 4000);
|
||||
};
|
||||
|
||||
const stopAutoPlay = () => clearInterval(autoPlayTimer);
|
||||
|
||||
startAutoPlay();
|
||||
|
||||
slider.addEventListener("mouseenter", stopAutoPlay);
|
||||
slider.addEventListener("mouseleave", startAutoPlay);
|
||||
slider.addEventListener("touchstart", stopAutoPlay, { passive: true });
|
||||
slider.addEventListener("touchend", startAutoPlay);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
main#main > #AjaxMainSection > .section_top
|
||||
@@ -0,0 +1,28 @@
|
||||
(() => {
|
||||
const allBanners = document.querySelectorAll(`
|
||||
.vc-content_slidebanner .owl-carousel .owl-stage .owl-item:not(.cloned) .item img,
|
||||
.vc-content_slidebanner .owl-carousel > .item:not(.cloned) img
|
||||
`);
|
||||
|
||||
const allBannersResponsive = document.querySelectorAll(`
|
||||
.vc-content_slidebanner--responsive .owl-carousel .owl-stage .owl-item:not(.cloned) .item img,
|
||||
.vc-content_slidebanner--responsive .owl-carousel > .item:not(.cloned) img
|
||||
`);
|
||||
|
||||
const banners = Array.from(allBanners).map((banner) => {
|
||||
const src = banner.getAttribute("data-src");
|
||||
const alt = banner.getAttribute("alt");
|
||||
return { src, alt };
|
||||
});
|
||||
|
||||
const bannersResponsive = Array.from(allBannersResponsive).map((banner) => {
|
||||
const src = banner.getAttribute("data-src");
|
||||
const alt = banner.getAttribute("alt");
|
||||
return { src, alt };
|
||||
});
|
||||
|
||||
return {
|
||||
banners,
|
||||
bannersResponsive,
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,148 @@
|
||||
/* Base Container */
|
||||
.promo-section {
|
||||
padding: 2rem 0;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
.promo-section {
|
||||
padding: 3rem 0;
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: var(--max-w-7xl, 80rem);
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.container {
|
||||
padding: 0 1.5rem;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.container {
|
||||
padding: 0 2rem;
|
||||
}
|
||||
}
|
||||
|
||||
/* Display Logic & Breakpoints (770px as requested) */
|
||||
.desktop-slider {
|
||||
display: none;
|
||||
}
|
||||
.mobile-slider {
|
||||
display: block;
|
||||
}
|
||||
|
||||
@media (min-width: 770px) {
|
||||
.desktop-slider {
|
||||
display: block;
|
||||
}
|
||||
.mobile-slider {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* Slider Container */
|
||||
.slider-wrapper {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border-radius: 0.75rem;
|
||||
overflow: hidden;
|
||||
box-shadow:
|
||||
0 4px 6px -1px rgba(0, 0, 0, 0.1),
|
||||
0 2px 4px -1px rgba(0, 0, 0, 0.06);
|
||||
}
|
||||
|
||||
/* Scroll Track */
|
||||
.slider-track {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
scroll-snap-type: x mandatory;
|
||||
/* Removed CSS scroll-behavior: smooth so JS can perform 'instant' infinite jumps */
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.slider-track::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Individual Slide */
|
||||
.slide {
|
||||
flex: 0 0 100%;
|
||||
scroll-snap-align: start;
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Exact Aspect Ratios */
|
||||
.desktop-slider .slide {
|
||||
aspect-ratio: 1920 / 640;
|
||||
}
|
||||
.mobile-slider .slide {
|
||||
aspect-ratio: 1 / 1;
|
||||
}
|
||||
|
||||
.slide img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* Navigation Arrows */
|
||||
.slider-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
background: rgba(255, 255, 255, 0.8);
|
||||
color: #1f2937;
|
||||
border: none;
|
||||
width: 2.5rem;
|
||||
height: 2.5rem;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
z-index: 10;
|
||||
transition: background 0.2s;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.slider-btn:hover {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
}
|
||||
.slider-btn svg {
|
||||
width: 1.25rem;
|
||||
height: 1.25rem;
|
||||
}
|
||||
.slider-btn.prev {
|
||||
left: 1rem;
|
||||
}
|
||||
.slider-btn.next {
|
||||
right: 1rem;
|
||||
}
|
||||
|
||||
/* Pagination Dots */
|
||||
.slider-dots {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
display: flex;
|
||||
gap: 0.5rem;
|
||||
z-index: 10;
|
||||
}
|
||||
.slider-dot {
|
||||
width: 0.625rem;
|
||||
height: 0.625rem;
|
||||
border-radius: 50%;
|
||||
background: rgba(255, 255, 255, 0.4);
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
.slider-dot.active {
|
||||
background: rgba(255, 255, 255, 1);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
<section class="promo-section">
|
||||
<div class="container">
|
||||
<!-- DESKTOP SLIDER (1920x640) -->
|
||||
<div class="desktop-slider">
|
||||
<div class="slider-wrapper js-slider-wrapper">
|
||||
<div class="slider-track js-slider-track">
|
||||
{{#each banners}}
|
||||
<div class="slide">
|
||||
<img src="{{this.src}}" alt="{{this.alt}}" loading="lazy" />
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<button class="slider-btn prev js-slider-prev" aria-label="Předchozí">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m15 18-6-6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
<button class="slider-btn next js-slider-next" aria-label="Další">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m9 18 6-6-6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="slider-dots js-slider-dots">
|
||||
{{#each banners}}
|
||||
<button
|
||||
class="slider-dot {{#if @first}}active{{/if}}"
|
||||
data-index="{{@index}}"
|
||||
aria-label="Zobrazit banner {{@index}}"
|
||||
></button>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- MOBILE SLIDER (600x600) -->
|
||||
<div class="mobile-slider">
|
||||
<div class="slider-wrapper js-slider-wrapper">
|
||||
<div class="slider-track js-slider-track">
|
||||
{{#each bannersResponsive}}
|
||||
<div class="slide">
|
||||
<img src="{{this.src}}" alt="{{this.alt}}" loading="lazy" />
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<button class="slider-btn prev js-slider-prev" aria-label="Předchozí">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m15 18-6-6 6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
<button class="slider-btn next js-slider-next" aria-label="Další">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
>
|
||||
<path d="m9 18 6-6-6-6" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
<div class="slider-dots js-slider-dots">
|
||||
{{#each bannersResponsive}}
|
||||
<button
|
||||
class="slider-dot {{#if @first}}active{{/if}}"
|
||||
data-index="{{@index}}"
|
||||
aria-label="Zobrazit banner {{@index}}"
|
||||
></button>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1 @@
|
||||
main#main #AjaxMainSection section.section_middle_before
|
||||
@@ -0,0 +1,31 @@
|
||||
(() => {
|
||||
const main = document.querySelector("main#main #AjaxMainSection section.section_middle_before .vc-menu_categorytop");
|
||||
|
||||
const items = main.querySelectorAll("div.item > .inner");
|
||||
|
||||
const data = Array.from(items).map((item) => {
|
||||
const titleA = item.querySelector("h2.title > a");
|
||||
const link = titleA.href;
|
||||
const title = titleA.querySelector("span").textContent.trim();
|
||||
const img = titleA.querySelector("img").src;
|
||||
const img_alt = titleA.querySelector("img").alt;
|
||||
const subItems = item.querySelectorAll(".subitems > ul > li > a");
|
||||
const subItemsData = Array.from(subItems).map((subItem) => {
|
||||
const subLink = subItem.href;
|
||||
const subTitle = subItem.textContent.trim();
|
||||
return { title: subTitle, link: subLink };
|
||||
});
|
||||
|
||||
return {
|
||||
title,
|
||||
link,
|
||||
img: {
|
||||
src: img,
|
||||
alt: img_alt
|
||||
},
|
||||
subItems: subItemsData
|
||||
};
|
||||
});
|
||||
|
||||
return data;
|
||||
})();
|
||||
@@ -0,0 +1,207 @@
|
||||
:root {
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.category-section {
|
||||
font-family: var(--font-sans);
|
||||
padding: 4rem 0; /* py-16 */
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.category-section {
|
||||
padding: 6rem 0; /* lg:py-24 */
|
||||
}
|
||||
}
|
||||
|
||||
.category-container {
|
||||
max-width: 80rem; /* max-w-7xl */
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem; /* px-4 */
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.category-container {
|
||||
padding: 0 1.5rem; /* sm:px-6 */
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.category-container {
|
||||
padding: 0 2rem; /* lg:px-8 */
|
||||
}
|
||||
}
|
||||
|
||||
.category-header {
|
||||
text-align: center;
|
||||
margin-bottom: 3rem; /* mb-12 */
|
||||
}
|
||||
|
||||
.category-header h2 {
|
||||
font-size: 1.5rem; /* text-2xl */
|
||||
font-weight: 700;
|
||||
color: var(--foreground);
|
||||
margin: 0 0 1rem 0; /* mb-4 */
|
||||
line-height: 1.2;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.category-header h2 {
|
||||
font-size: 1.875rem; /* md:text-3xl */
|
||||
}
|
||||
}
|
||||
|
||||
.category-header p {
|
||||
color: var(--muted-foreground);
|
||||
max-width: 42rem; /* max-w-2xl */
|
||||
margin: 0 auto;
|
||||
font-size: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
/*
|
||||
* RESPONSIVE GRID
|
||||
* Mobile: 1 column
|
||||
* Small (640px+): 2 columns
|
||||
* Large (1024px+): 4 columns
|
||||
*/
|
||||
.category-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr; /* Default: 1 column on mobile */
|
||||
gap: 1rem; /* gap-4 */
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.category-grid {
|
||||
grid-template-columns: repeat(2, 1fr); /* sm:grid-cols-2 */
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.category-grid {
|
||||
gap: 1.5rem; /* md:gap-6 */
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.category-grid {
|
||||
grid-template-columns: repeat(4, 1fr); /* lg:grid-cols-4 */
|
||||
}
|
||||
}
|
||||
|
||||
.category-card {
|
||||
position: relative;
|
||||
display: block;
|
||||
aspect-ratio: 1 / 1; /* aspect-square */
|
||||
border-radius: 0.75rem; /* rounded-xl */
|
||||
overflow: hidden;
|
||||
background-color: var(--secondary);
|
||||
text-decoration: none;
|
||||
/* Acts as Tailwind 'group' */
|
||||
}
|
||||
|
||||
.category-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s ease-in-out;
|
||||
}
|
||||
|
||||
.category-card:hover .category-img {
|
||||
transform: scale(1.1); /* group-hover:scale-110 */
|
||||
}
|
||||
|
||||
.category-overlay {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
/* Equivalent to from-primary/90 via-primary/40 to-transparent */
|
||||
background: linear-gradient(
|
||||
to top,
|
||||
color-mix(in srgb, var(--primary) 90%, transparent) 0%,
|
||||
color-mix(in srgb, var(--primary) 40%, transparent) 50%,
|
||||
transparent 100%
|
||||
);
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.category-content {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
padding: 1.5rem; /* Generous padding since it's full width on mobile */
|
||||
z-index: 2;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.category-content {
|
||||
padding: 1rem;
|
||||
} /* Tighter padding when 2 cols on small tablet */
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.category-content {
|
||||
padding: 1.5rem; /* md:p-6 */
|
||||
}
|
||||
}
|
||||
|
||||
.category-title {
|
||||
font-size: 1.25rem; /* Larger by default on mobile since it's 1 column */
|
||||
font-weight: 700;
|
||||
color: var(--primary-foreground);
|
||||
margin: 0 0 0.25rem 0; /* mb-1 */
|
||||
line-height: 1.2;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.category-title {
|
||||
font-size: 1.125rem;
|
||||
} /* text-lg when shrunk to 2 cols */
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.category-title {
|
||||
font-size: 1.25rem; /* md:text-xl */
|
||||
}
|
||||
}
|
||||
|
||||
.category-desc {
|
||||
color: color-mix(
|
||||
in srgb,
|
||||
var(--primary-foreground) 70%,
|
||||
transparent
|
||||
); /* text-primary-foreground/70 */
|
||||
font-size: 0.875rem;
|
||||
margin: 0;
|
||||
line-height: 1.4;
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.category-desc {
|
||||
font-size: 0.75rem;
|
||||
} /* text-xs */
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.category-desc {
|
||||
font-size: 0.875rem; /* md:text-sm */
|
||||
}
|
||||
}
|
||||
|
||||
.category-action {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem; /* gap-2 */
|
||||
color: var(--accent);
|
||||
font-size: 0.875rem; /* text-sm */
|
||||
font-weight: 500;
|
||||
margin-top: 0.75rem; /* mt-3 */
|
||||
|
||||
/* Animation initial state */
|
||||
opacity: 0;
|
||||
transform: translateY(0.5rem); /* translate-y-2 */
|
||||
transition: all 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.category-card:hover .category-action {
|
||||
opacity: 1; /* group-hover:opacity-100 */
|
||||
transform: translateY(0); /* group-hover:translate-y-0 */
|
||||
}
|
||||
|
||||
.category-action svg {
|
||||
width: 1rem; /* w-4 */
|
||||
height: 1rem; /* h-4 */
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<section class="category-section">
|
||||
<div class="category-container">
|
||||
<div class="category-header">
|
||||
<h2>Procházejte kategorie</h2>
|
||||
<p>Najděte svůj styl v našich pečlivě vybraných kolekcích</p>
|
||||
</div>
|
||||
|
||||
<div class="category-grid">
|
||||
{{#each this}}
|
||||
<a href="{{this.link}}" class="category-card">
|
||||
<img
|
||||
src="{{this.img.src}}"
|
||||
alt="{{this.img.alt}}"
|
||||
class="category-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
<div class="category-overlay"></div>
|
||||
|
||||
<div class="category-content">
|
||||
<h3 class="category-title">{{this.title}}</h3>
|
||||
|
||||
<p class="category-desc">
|
||||
<!-- Render subitems separated by bullet points -->
|
||||
{{#each this.subItems}}
|
||||
{{this.title}}{{#unless @last}} • {{/unless}}
|
||||
{{/each}}
|
||||
</p>
|
||||
|
||||
<div class="category-action">
|
||||
Prohlédnout
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path d="M5 12h14"></path>
|
||||
<path d="m12 5 7 7-7 7"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@@ -0,0 +1,23 @@
|
||||
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
const tabBtns = document.querySelectorAll('.js-tab-btn');
|
||||
const tabPanes = document.querySelectorAll('.js-tab-pane');
|
||||
|
||||
tabBtns.forEach(btn => {
|
||||
btn.addEventListener('click', () => {
|
||||
// Remove active class from all buttons and panes
|
||||
tabBtns.forEach(b => b.classList.remove('active'));
|
||||
tabPanes.forEach(p => p.classList.remove('active'));
|
||||
|
||||
// Add active class to clicked button
|
||||
btn.classList.add('active');
|
||||
|
||||
// Show corresponding pane
|
||||
const targetId = btn.getAttribute('data-target');
|
||||
const targetPane = document.getElementById(targetId);
|
||||
if (targetPane) {
|
||||
targetPane.classList.add('active');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
main#main #AjaxMainSection section.section_middle
|
||||
@@ -0,0 +1,89 @@
|
||||
(() => {
|
||||
const main = document.querySelector("main#main #AjaxMainSection section.section_middle > .container > .inner > .vc-tabstemplate");
|
||||
|
||||
if (!main) return null;
|
||||
|
||||
const tabs = main.querySelectorAll(".inner > nav > ul > li > a > span");
|
||||
const tabTexts = Array.from(tabs).map((tab) => tab.textContent.trim());
|
||||
|
||||
const body = main.querySelector(".body");
|
||||
|
||||
const finalData = {
|
||||
names: tabTexts,
|
||||
contents: {},
|
||||
};
|
||||
|
||||
for (let i = 0; i < tabTexts.length; i++) {
|
||||
const idName = `Index_${i + 1}`;
|
||||
|
||||
const items = body.querySelectorAll(`#${idName} .owl-item > article.commodityBox`);
|
||||
|
||||
const itemsData = Array.from(items).map((item) => {
|
||||
const productNode = item.querySelector("a.inner");
|
||||
|
||||
const link = productNode.getAttribute("href");
|
||||
|
||||
// UPDATED: Extracting background and text colors using getComputedStyle
|
||||
const flagsElements = productNode.querySelectorAll(".flags > .flags-inner > .flag");
|
||||
const flags = Array.from(flagsElements).map((flag) => {
|
||||
const styles = window.getComputedStyle(flag);
|
||||
return {
|
||||
text: flag.textContent.trim(),
|
||||
backgroundColor: styles.backgroundColor,
|
||||
textColor: styles.color
|
||||
};
|
||||
});
|
||||
|
||||
const imageEl = productNode.querySelector(".image > img");
|
||||
const imageSrc = imageEl ? (imageEl.getAttribute("data-src") || imageEl.getAttribute("src")) : null;
|
||||
const imageAlt = imageEl ? imageEl.getAttribute("alt") : null;
|
||||
|
||||
const descriptionEl = productNode.querySelector(".annotation > p");
|
||||
const description = descriptionEl ? descriptionEl.textContent.trim() : null;
|
||||
|
||||
const titleEl = productNode.querySelector(".title > span");
|
||||
const title = titleEl ? titleEl.textContent.trim() : null;
|
||||
|
||||
const buyFormEl = productNode.querySelector(".buyForm");
|
||||
const buyFormContent = buyFormEl ? buyFormEl.innerHTML.trim() : null;
|
||||
|
||||
const priceEl = productNode.querySelector(".pricing > .pricing-inner");
|
||||
|
||||
let priceDiscount = null;
|
||||
let priceBeforeDiscount = null;
|
||||
let priceHighlight = null;
|
||||
|
||||
if (priceEl) {
|
||||
const priceDiscountEl = priceEl.querySelector(".discount .number");
|
||||
priceDiscount = priceDiscountEl ? parseInt(priceDiscountEl.textContent.trim(), 10) : null;
|
||||
|
||||
const priceBeforeDiscountEl = priceEl.querySelector(".price.beforeDiscount");
|
||||
priceBeforeDiscount = priceBeforeDiscountEl ? priceBeforeDiscountEl.textContent.trim().replace(/\s+/g, ' ') : null;
|
||||
|
||||
const priceHighlightEl = priceEl.querySelector(".price.highlight");
|
||||
priceHighlight = priceHighlightEl ? priceHighlightEl.textContent.trim().replace(/\s+/g, ' ') : null;
|
||||
}
|
||||
|
||||
const availabilityEl = productNode.querySelector(".availability strong");
|
||||
const availability = availabilityEl ? availabilityEl.textContent.trim() : null;
|
||||
|
||||
return {
|
||||
title,
|
||||
link,
|
||||
flags,
|
||||
imageSrc,
|
||||
imageAlt,
|
||||
description,
|
||||
priceHighlight,
|
||||
priceBeforeDiscount,
|
||||
priceDiscount,
|
||||
availability,
|
||||
buyFormContent
|
||||
};
|
||||
});
|
||||
|
||||
finalData.contents[tabTexts[i]] = itemsData;
|
||||
}
|
||||
|
||||
return finalData;
|
||||
})();
|
||||
@@ -0,0 +1,272 @@
|
||||
:root {
|
||||
--primary: oklch(0.205 0 0);
|
||||
--primary-foreground: oklch(0.985 0 0);
|
||||
--secondary: oklch(0.97 0 0);
|
||||
--card: oklch(1 0 0);
|
||||
--foreground: oklch(0.145 0 0);
|
||||
--muted-foreground: oklch(0.556 0 0);
|
||||
--accent: oklch(0.97 0 0);
|
||||
--border: oklch(0.922 0 0);
|
||||
--sale-bg: #ef4444; /* Red for discounts */
|
||||
--sale-fg: #ffffff;
|
||||
--success-text: #10b981; /* Green for in-stock */
|
||||
--font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
|
||||
}
|
||||
|
||||
.featured-section {
|
||||
font-family: var(--font-sans);
|
||||
padding: 4rem 0; /* py-16 */
|
||||
background-color: color-mix(
|
||||
in srgb,
|
||||
var(--secondary) 30%,
|
||||
transparent
|
||||
); /* bg-secondary/30 */
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.featured-section {
|
||||
padding: 6rem 0; /* lg:py-24 */
|
||||
}
|
||||
}
|
||||
|
||||
.container {
|
||||
max-width: 80rem; /* max-w-7xl */
|
||||
margin: 0 auto;
|
||||
padding: 0 1rem; /* px-4 */
|
||||
}
|
||||
@media (min-width: 640px) {
|
||||
.container {
|
||||
padding: 0 1.5rem; /* sm:px-6 */
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.container {
|
||||
padding: 0 2rem; /* lg:px-8 */
|
||||
}
|
||||
}
|
||||
|
||||
/* Tabs */
|
||||
.tabs-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 0.5rem; /* gap-2 */
|
||||
margin-bottom: 3rem; /* mb-12 */
|
||||
}
|
||||
|
||||
.tab-btn {
|
||||
padding: 0.5rem 1.5rem; /* px-6 py-2 */
|
||||
border-radius: 9999px; /* rounded-full */
|
||||
font-size: 0.875rem; /* text-sm */
|
||||
font-weight: 500; /* font-medium */
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease;
|
||||
background-color: var(--card);
|
||||
color: var(--foreground);
|
||||
border: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.tab-btn:hover {
|
||||
background-color: var(--secondary);
|
||||
}
|
||||
|
||||
.tab-btn.active {
|
||||
background-color: var(--primary);
|
||||
color: var(--primary-foreground);
|
||||
border-color: var(--primary);
|
||||
}
|
||||
|
||||
/* Grid Layout & Tab Panes */
|
||||
.tab-pane {
|
||||
visibility: hidden;
|
||||
opacity: 0;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
.tab-pane.active {
|
||||
visibility: visible;
|
||||
opacity: 1;
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.product-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr); /* grid-cols-2 */
|
||||
gap: 1rem; /* gap-4 */
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.product-grid {
|
||||
grid-template-columns: repeat(3, 1fr); /* md:grid-cols-3 */
|
||||
gap: 1.5rem; /* md:gap-6 */
|
||||
}
|
||||
}
|
||||
@media (min-width: 1024px) {
|
||||
.product-grid {
|
||||
grid-template-columns: repeat(4, 1fr); /* lg:grid-cols-4 */
|
||||
}
|
||||
}
|
||||
|
||||
/* Product Card */
|
||||
.product-card {
|
||||
position: relative;
|
||||
background-color: var(--card);
|
||||
border-radius: 0.75rem; /* rounded-xl */
|
||||
overflow: hidden;
|
||||
border: 1px solid var(--border);
|
||||
transition: all 0.3s ease;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.product-card:hover {
|
||||
box-shadow:
|
||||
0 20px 25px -5px rgba(0, 0, 0, 0.1),
|
||||
0 8px 10px -6px rgba(0, 0, 0, 0.1); /* shadow-xl */
|
||||
}
|
||||
|
||||
/* Badges */
|
||||
.product-badges {
|
||||
position: absolute;
|
||||
top: 0.75rem; /* top-3 */
|
||||
left: 0.75rem; /* left-3 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.5rem; /* gap-2 */
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.badge {
|
||||
padding: 0.25rem 0.5rem; /* px-2 py-1 */
|
||||
font-size: 0.75rem; /* text-xs */
|
||||
font-weight: 600; /* font-semibold */
|
||||
border-radius: 0.25rem; /* rounded */
|
||||
line-height: 1;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.badge-discount {
|
||||
background-color: var(--sale-bg);
|
||||
color: var(--sale-fg);
|
||||
}
|
||||
|
||||
/* Image Area */
|
||||
.product-link {
|
||||
text-decoration: none;
|
||||
color: inherit;
|
||||
display: block;
|
||||
flex: 1; /* Pushes footer to the bottom */
|
||||
}
|
||||
|
||||
.product-img-wrapper {
|
||||
position: relative;
|
||||
aspect-ratio: 4 / 5;
|
||||
background-color: var(--secondary);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.product-img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
transition: transform 0.5s ease;
|
||||
}
|
||||
.product-card:hover .product-img {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
/* Content Area */
|
||||
.product-info {
|
||||
padding: 1rem; /* p-4 */
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.product-desc {
|
||||
font-size: 0.75rem; /* text-xs */
|
||||
color: var(--muted-foreground);
|
||||
margin: 0 0 0.25rem 0; /* mb-1 */
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.product-title {
|
||||
font-size: 1rem;
|
||||
font-weight: 600; /* font-semibold */
|
||||
color: var(--foreground);
|
||||
margin: 0 0 0.75rem 0; /* mb-3 */
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
line-height: 1.3;
|
||||
transition: color 0.2s;
|
||||
}
|
||||
.product-card:hover .product-title {
|
||||
color: var(--accent);
|
||||
}
|
||||
|
||||
.product-pricing {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 0.5rem; /* gap-2 */
|
||||
margin-bottom: 0.75rem; /* mb-3 */
|
||||
}
|
||||
|
||||
.price-current {
|
||||
font-size: 1.125rem; /* text-lg */
|
||||
font-weight: 700; /* font-bold */
|
||||
color: var(--foreground);
|
||||
}
|
||||
|
||||
.price-original {
|
||||
font-size: 0.875rem; /* text-sm */
|
||||
color: var(--muted-foreground);
|
||||
text-decoration: line-through;
|
||||
}
|
||||
|
||||
/* Footer (Availability & Button) */
|
||||
.product-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
margin-top: auto;
|
||||
}
|
||||
|
||||
.product-availability {
|
||||
font-size: 0.75rem; /* text-xs */
|
||||
font-weight: 500;
|
||||
color: var(--muted-foreground);
|
||||
}
|
||||
/* Soft-matching text for Skladem */
|
||||
.product-availability[data-status*="Skladem"] {
|
||||
color: var(--success-text);
|
||||
}
|
||||
|
||||
/* Style the injected raw form and button */
|
||||
.product-buy-form {
|
||||
margin: 0;
|
||||
}
|
||||
.product-buy-form .btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 0.5rem 1rem; /* px-4 py-2 */
|
||||
background-color: var(--primary);
|
||||
color: var(--primary-foreground);
|
||||
border-radius: 0.5rem; /* rounded-lg */
|
||||
font-size: 0.875rem; /* text-sm */
|
||||
font-weight: 500; /* font-medium */
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
font-family: inherit;
|
||||
}
|
||||
.product-buy-form .btn:hover {
|
||||
background-color: color-mix(
|
||||
in srgb,
|
||||
var(--primary) 90%,
|
||||
transparent
|
||||
); /* hover:bg-primary/90 */
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<section class="featured-section">
|
||||
<div class="container">
|
||||
<!-- TABS -->
|
||||
<div class="tabs-container">
|
||||
{{#each names}}
|
||||
<button
|
||||
class="tab-btn js-tab-btn {{#if @first}}active{{/if}}"
|
||||
data-target="tab-{{@index}}"
|
||||
>
|
||||
{{this}}
|
||||
</button>
|
||||
{{/each}}
|
||||
</div>
|
||||
|
||||
<!-- TAB CONTENTS -->
|
||||
<div class="tab-contents">
|
||||
{{#each contents}}
|
||||
<div
|
||||
class="tab-pane js-tab-pane {{#if @first}}active{{/if}}"
|
||||
id="tab-{{@index}}"
|
||||
>
|
||||
<div class="product-grid">
|
||||
{{#each this}}
|
||||
<div class="product-card">
|
||||
<!-- Badges (Flags + Discount) -->
|
||||
<div class="product-badges">
|
||||
{{#each this.flags}}
|
||||
<span
|
||||
class="badge"
|
||||
style="background-color: {{this.backgroundColor}}; color: {{this.textColor}};"
|
||||
>
|
||||
{{this.text}}
|
||||
</span>
|
||||
{{/each}} {{#if this.priceDiscount}}
|
||||
<span class="badge badge-discount">
|
||||
{{this.priceDiscount}}%
|
||||
</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
||||
<!-- Product Link & Image & Text -->
|
||||
<a href="{{this.link}}" class="product-link">
|
||||
<div class="product-img-wrapper">
|
||||
<img
|
||||
src="{{this.imageSrc}}"
|
||||
alt="{{this.imageAlt}}"
|
||||
class="product-img"
|
||||
loading="lazy"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="product-info">
|
||||
{{#if this.description}}
|
||||
<p class="product-desc">{{this.description}}</p>
|
||||
{{/if}}
|
||||
|
||||
<h3 class="product-title">{{this.title}}</h3>
|
||||
|
||||
<div class="product-pricing">
|
||||
<span class="price-current">{{this.priceHighlight}}</span>
|
||||
{{#if this.priceBeforeDiscount}}
|
||||
<span class="price-original"
|
||||
>{{this.priceBeforeDiscount}}</span
|
||||
>
|
||||
{{/if}}
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<div class="product-info" style="padding-top: 0">
|
||||
<div class="product-footer">
|
||||
<span
|
||||
class="product-availability"
|
||||
data-status="{{this.availability}}"
|
||||
>
|
||||
{{#if (eq this.availability "Skladem")}}✓
|
||||
{{/if}}{{this.availability}}
|
||||
</span>
|
||||
|
||||
<div class="product-buy-form">{{{this.buyFormContent}}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
{{/each}}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
Reference in New Issue
Block a user