BAILE DO HAWAI 2017

4 jan, 2018

Mais uma ano de SUCESSO, assim foi o nosso Baile do Hawai. Muita diversão, música boa e felicidade em uma grande noite, Obrigado a todos os associados que prestigiaram e desfrutaram da melhor forma esse evento. Confira as FOTOS. { return !img.closest('.et_pb_menu') && !img.closest('.et_pb_image_0_tb_header') && !img.classList.contains('lightbox-img'); }); if (rawImages.length === 0) return; // 3. Criar o Container da Grade const gridContainer = document.createElement('div'); gridContainer.className = 'galeria-grid-container'; // 4. Criar a Estrutura do Lightbox (se não existir) let lightbox = document.querySelector('.galeria-lightbox'); if (!lightbox) { lightbox = document.createElement('div'); lightbox.className = 'galeria-lightbox'; lightbox.innerHTML = `

`; document.body.appendChild(lightbox); } const lightboxImg = lightbox.querySelector('.lightbox-img'); const info = lightbox.querySelector('.lightbox-info'); const closeBtn = lightbox.querySelector('.btn-close'); const prevBtn = lightbox.querySelector('.btn-prev'); const nextBtn = lightbox.querySelector('.btn-next'); let currentIndex = 0; const imageList = []; // 5. Processar as imagens rawImages.forEach((img) => { // Evitar duplicados na lista do lightbox if (!imageList.includes(img.src)) { imageList.push(img.src); const item = document.createElement('div'); item.className = 'galeria-item'; const newImg = document.createElement('img'); newImg.src = img.src; newImg.alt = img.alt || 'Imagem da Galeria'; item.appendChild(newImg); gridContainer.appendChild(item); // Evento de clique const itemIndex = imageList.length - 1; item.onclick = () => openLightbox(itemIndex); } // REMOÇÃO TOTAL: Remove a imagem original e qualquer container de carrossel antigo const oldSlider = img.closest('.custom-post-slider'); if (oldSlider) { oldSlider.remove(); } else { img.remove(); } }); // 6. Inserir a nova grade no conteúdo contentArea.appendChild(gridContainer); // 7. Funções do Lightbox function openLightbox(index) { currentIndex = index; updateLightbox(); lightbox.classList.add('active'); document.body.style.overflow = 'hidden'; } function updateLightbox() { if (imageList[currentIndex]) { lightboxImg.src = imageList[currentIndex]; info.textContent = `${currentIndex + 1} / ${imageList.length}`; } } function closeLightbox() { lightbox.classList.remove('active'); document.body.style.overflow = ''; } function nextImg() { currentIndex = (currentIndex + 1) % imageList.length; updateLightbox(); } function prevImg() { currentIndex = (currentIndex - 1 + imageList.length) % imageList.length; updateLightbox(); } // Eventos closeBtn.onclick = closeLightbox; nextBtn.onclick = (e) => { e.stopPropagation(); nextImg(); }; prevBtn.onclick = (e) => { e.stopPropagation(); prevImg(); }; lightbox.onclick = (e) => { if (e.target === lightbox) closeLightbox(); }; document.addEventListener('keydown', (e) => { if (!lightbox.classList.contains('active')) return; if (e.key === 'Escape') closeLightbox(); if (e.key === 'ArrowRight') nextImg(); if (e.key === 'ArrowLeft') prevImg(); }); // Swipe Mobile let touchStartX = 0; lightbox.addEventListener('touchstart', e => touchStartX = e.changedTouches[0].screenX, {passive: true}); lightbox.addEventListener('touchend', e => { let touchEndX = e.changedTouches[0].screenX; if (touchStartX - touchEndX > 60) nextImg(); if (touchEndX - touchStartX > 60) prevImg(); }, {passive: true}); });