Beechfield se síťkou Snapback Trucker
Beechfield Bavlna/polyesterová síťovina snapback modrá
Objednat POTISK/VÝŠIVKU
Kšiltovka se síťkou TRUCKER
5dílná, přední panel bez švů
6 krát prošitý kšilt
přední panel a kšilt: 100% bavlna, zadní panely: 100% polyester (síťové)
spona v retro stylu
obvod čepice 52 - 60 cm
vhodná pro tisk a výšivku
k dispozici také ve velikosti pro děti ZDE
Hotové zakázky:
Zobrazit vše
× ❮ ❯
let currentImgIndex = 0;
let imagesArray = [];
function initCustomGaller...
Kšiltovka se síťkou TRUCKER
5dílná, přední panel bez švů
6 krát prošitý kšilt
přední panel a kšilt: 100% bavlna, zadní panely: 100% polyester (síťové)
spona v retro stylu
obvod čepice 52 - 60 cm
vhodná pro tisk a výšivku
k dispozici také ve velikosti pro děti ZDE
Hotové zakázky:
Zobrazit vše
× ❮ ❯
let currentImgIndex = 0;
let imagesArray = [];
function initCustomGalleries() {
const gallery = document.querySelector('.custom-gallery');
if (!gallery) return;
const items = gallery.querySelectorAll('.custom-gallery-item');
imagesArray = Array.from(items).map(item => item.getAttribute('href'));
const isMobile = window.innerWidth < 768;
const maxVisible = isMobile ? parseInt(gallery.dataset.maxMobile) : parseInt(gallery.dataset.maxPc);
const btn = gallery.parentElement.querySelector('.gallery-toggle-btn');
if (items.length > maxVisible) {
items.forEach((item, index) => {
if (index >= maxVisible) item.style.setProperty('display', 'none', 'important');
else item.style.setProperty('display', 'block', 'important');
});
if(btn) btn.style.display = 'block';
} else {
items.forEach(item => item.style.setProperty('display', 'block', 'important'));
if(btn) btn.style.display = 'none';
}
}
function toggleCustomGallery(btn) {
const items = btn.parentElement.querySelectorAll('.custom-gallery-item');
items.forEach(item => item.style.setProperty('display', 'block', 'important'));
btn.style.display = 'none';
}
// Funkce pro Lightbox (Zvětšení)
function openLightbox(index) {
currentImgIndex = index;
document.getElementById('lightboxImg').src = imagesArray[currentImgIndex];
document.getElementById('customLightbox').style.display = 'flex';
document.body.style.overflow = 'hidden'; // Zastaví rolování stránky na pozadí
}
function closeLightboxForce() {
document.getElementById('customLightbox').style.display = 'none';
document.body.style.overflow = 'auto'; // Vrátí rolování stránky
}
function closeLightbox(e) {
// Zavře okno pouze pokud kliknete na černé pozadí, ne na fotku nebo šipku
if (e.target.id === 'customLightbox') {
closeLightboxForce();
}
}
function changeImg(direction, e) {
if(e) e.stopPropagation();
currentImgIndex += direction;
if (currentImgIndex >= imagesArray.length) currentImgIndex = 0;
if (currentImgIndex < 0) currentImgIndex = imagesArray.length - 1;
document.getElementById('lightboxImg').src = imagesArray[currentImgIndex];
}
// Ovládání klávesnicí (Šipky a ESC)
document.addEventListener('keydown', function(e) {
const lightbox = document.getElementById('customLightbox');
if (lightbox && lightbox.style.display === 'flex') {
if (e.key === "Escape" || e.key === "Esc") {
closeLightboxForce();
} else if (e.key === "ArrowRight") {
changeImg(1);
} else if (e.key === "ArrowLeft") {
changeImg(-1);
}
}
});
window.addEventListener('DOMContentLoaded', initCustomGalleries);
window.addEventListener('resize', initCustomGalleries);
setTimeout(initCustomGalleries, 500);