style(frontend): match carousel nav to admin (square dots, overlay arrows)
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 2m59s
All checks were successful
Build & Deploy to K3s / build-and-deploy (push) Successful in 2m59s
Frontend product panel now mirrors the admin preview: 14px black square dots with a 1px yellow border and a 6px yellow inner square when active, and prev/next arrows as dark overlay buttons on the image sides that fade in on hover. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
6583a7295a
commit
1dbcef4660
@ -514,50 +514,91 @@ hr {
|
||||
opacity: 0.92;
|
||||
}
|
||||
|
||||
/* Gallery navigation */
|
||||
/* Gallery navigation — dots overlay at the bottom of the image, arrows overlay on sides */
|
||||
.panel-gallery-nav {
|
||||
position: absolute;
|
||||
bottom: 0.75rem;
|
||||
left: 0;
|
||||
right: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
padding: 12px 0;
|
||||
background: #1a1a1a;
|
||||
border-top: 1px solid rgba(232, 168, 0, 0.15);
|
||||
gap: 0.45rem;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border-top: none;
|
||||
z-index: 3;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.panel-gallery-nav > * {
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
/* Square dot: 14×14 black with yellow border, yellow inner 6×6 square when active */
|
||||
.gallery-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
background: #111;
|
||||
border: 1px solid var(--amber);
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
transition: background 0.2s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.gallery-dot.active {
|
||||
.gallery-dot::before {
|
||||
content: '';
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
background: transparent;
|
||||
transition: background 0.15s;
|
||||
}
|
||||
|
||||
.gallery-dot.active::before {
|
||||
background: var(--amber);
|
||||
}
|
||||
|
||||
.gallery-dot:hover {
|
||||
background: rgba(232, 168, 0, 0.5);
|
||||
/* Arrows: overlay on image sides, shown on hover */
|
||||
.gallery-arrow {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 2.4rem;
|
||||
height: 2.4rem;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: rgba(0, 0, 0, 0.55);
|
||||
color: #fff;
|
||||
border: 1px solid rgba(255, 255, 255, 0.25);
|
||||
font-family: 'Space Mono', monospace;
|
||||
font-size: 1rem;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity 0.15s, background 0.15s, color 0.15s;
|
||||
z-index: 4;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.gallery-arrow {
|
||||
background: none;
|
||||
border: 1px solid rgba(232, 168, 0, 0.3);
|
||||
color: var(--amber);
|
||||
font-family: 'Space Mono', monospace;
|
||||
font-size: 0.75rem;
|
||||
cursor: pointer;
|
||||
padding: 2px 8px;
|
||||
transition: border-color 0.2s, background 0.2s;
|
||||
.panel-img-col:hover .gallery-arrow {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.gallery-arrow:hover {
|
||||
border-color: var(--amber);
|
||||
background: rgba(232, 168, 0, 0.1);
|
||||
background: rgba(232, 168, 0, 0.85);
|
||||
color: #111;
|
||||
border-color: rgba(255, 255, 255, 0.25);
|
||||
}
|
||||
|
||||
.gallery-prev {
|
||||
left: 0.75rem;
|
||||
}
|
||||
|
||||
.gallery-next {
|
||||
right: 0.75rem;
|
||||
}
|
||||
|
||||
/* Colonne infos : scrollable */
|
||||
|
||||
@ -416,8 +416,12 @@ function reboursInit() {
|
||||
fields.img.alt = card.dataset.imgAlt || card.dataset.name;
|
||||
}
|
||||
|
||||
// Build nav dots
|
||||
// Build nav dots (centered overlay at image bottom) + arrows (side overlays on image)
|
||||
fields.galleryNav.innerHTML = '';
|
||||
// Remove any previously injected arrows (they live on .panel-img-col)
|
||||
const imgCol = fields.galleryNav.parentElement;
|
||||
imgCol?.querySelectorAll('.gallery-arrow').forEach((el) => el.remove());
|
||||
|
||||
if (currentGalleryImages.length > 1) {
|
||||
fields.galleryNav.style.display = 'flex';
|
||||
currentGalleryImages.forEach((_, i) => {
|
||||
@ -428,9 +432,10 @@ function reboursInit() {
|
||||
fields.galleryNav.appendChild(dot);
|
||||
});
|
||||
|
||||
// Arrow buttons
|
||||
// Arrow buttons — appended to .panel-img-col so they overlay the image
|
||||
const prevBtn = document.createElement('button');
|
||||
prevBtn.className = 'gallery-arrow gallery-prev';
|
||||
prevBtn.type = 'button';
|
||||
prevBtn.textContent = '←';
|
||||
prevBtn.setAttribute('aria-label', 'Image précédente');
|
||||
prevBtn.addEventListener('click', () => {
|
||||
@ -439,14 +444,15 @@ function reboursInit() {
|
||||
|
||||
const nextBtn = document.createElement('button');
|
||||
nextBtn.className = 'gallery-arrow gallery-next';
|
||||
nextBtn.type = 'button';
|
||||
nextBtn.textContent = '→';
|
||||
nextBtn.setAttribute('aria-label', 'Image suivante');
|
||||
nextBtn.addEventListener('click', () => {
|
||||
showGalleryImage((currentGalleryIndex + 1) % currentGalleryImages.length);
|
||||
});
|
||||
|
||||
fields.galleryNav.prepend(prevBtn);
|
||||
fields.galleryNav.appendChild(nextBtn);
|
||||
imgCol?.appendChild(prevBtn);
|
||||
imgCol?.appendChild(nextBtn);
|
||||
} else {
|
||||
fields.galleryNav.style.display = 'none';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user