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

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:
ordinarthur 2026-04-21 18:34:43 +02:00
parent 6583a7295a
commit 1dbcef4660
2 changed files with 75 additions and 28 deletions

View File

@ -514,50 +514,91 @@ hr {
opacity: 0.92; opacity: 0.92;
} }
/* Gallery navigation */ /* Gallery navigation — dots overlay at the bottom of the image, arrows overlay on sides */
.panel-gallery-nav { .panel-gallery-nav {
position: absolute;
bottom: 0.75rem;
left: 0;
right: 0;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 8px; gap: 0.45rem;
padding: 12px 0; padding: 0;
background: #1a1a1a; background: transparent;
border-top: 1px solid rgba(232, 168, 0, 0.15); 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 { .gallery-dot {
width: 8px; width: 14px;
height: 8px; height: 14px;
border-radius: 50%; background: #111;
border: 1px solid var(--amber); border: 1px solid var(--amber);
background: transparent;
cursor: pointer; cursor: pointer;
padding: 0; 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); background: var(--amber);
} }
.gallery-dot:hover { /* Arrows: overlay on image sides, shown on hover */
background: rgba(232, 168, 0, 0.5); .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 { .panel-img-col:hover .gallery-arrow {
background: none; opacity: 1;
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;
} }
.gallery-arrow:hover { .gallery-arrow:hover {
border-color: var(--amber); background: rgba(232, 168, 0, 0.85);
background: rgba(232, 168, 0, 0.1); color: #111;
border-color: rgba(255, 255, 255, 0.25);
}
.gallery-prev {
left: 0.75rem;
}
.gallery-next {
right: 0.75rem;
} }
/* Colonne infos : scrollable */ /* Colonne infos : scrollable */

View File

@ -416,8 +416,12 @@ function reboursInit() {
fields.img.alt = card.dataset.imgAlt || card.dataset.name; 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 = ''; 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) { if (currentGalleryImages.length > 1) {
fields.galleryNav.style.display = 'flex'; fields.galleryNav.style.display = 'flex';
currentGalleryImages.forEach((_, i) => { currentGalleryImages.forEach((_, i) => {
@ -428,9 +432,10 @@ function reboursInit() {
fields.galleryNav.appendChild(dot); fields.galleryNav.appendChild(dot);
}); });
// Arrow buttons // Arrow buttons — appended to .panel-img-col so they overlay the image
const prevBtn = document.createElement('button'); const prevBtn = document.createElement('button');
prevBtn.className = 'gallery-arrow gallery-prev'; prevBtn.className = 'gallery-arrow gallery-prev';
prevBtn.type = 'button';
prevBtn.textContent = '←'; prevBtn.textContent = '←';
prevBtn.setAttribute('aria-label', 'Image précédente'); prevBtn.setAttribute('aria-label', 'Image précédente');
prevBtn.addEventListener('click', () => { prevBtn.addEventListener('click', () => {
@ -439,14 +444,15 @@ function reboursInit() {
const nextBtn = document.createElement('button'); const nextBtn = document.createElement('button');
nextBtn.className = 'gallery-arrow gallery-next'; nextBtn.className = 'gallery-arrow gallery-next';
nextBtn.type = 'button';
nextBtn.textContent = '→'; nextBtn.textContent = '→';
nextBtn.setAttribute('aria-label', 'Image suivante'); nextBtn.setAttribute('aria-label', 'Image suivante');
nextBtn.addEventListener('click', () => { nextBtn.addEventListener('click', () => {
showGalleryImage((currentGalleryIndex + 1) % currentGalleryImages.length); showGalleryImage((currentGalleryIndex + 1) % currentGalleryImages.length);
}); });
fields.galleryNav.prepend(prevBtn); imgCol?.appendChild(prevBtn);
fields.galleryNav.appendChild(nextBtn); imgCol?.appendChild(nextBtn);
} else { } else {
fields.galleryNav.style.display = 'none'; fields.galleryNav.style.display = 'none';
} }