Atelier do Doce

DOCE

COMO

 
 

 
 
You have been successfully Subscribed! Ops! Something went wrong, please try again.
document.addEventListener('DOMContentLoaded', function () { const offsetContainer = document.getElementById('offsetContainer'); const menuLinks = document.querySelectorAll('#offMenu li a'); const catLinks = document.querySelectorAll('.wpr-taxonomy-list li a'); const btnBurger = document.getElementById('btnBurger'); const ctaLink = document.querySelector('#mainCTA a'); let animationInProgress = false; if (!offsetContainer || !btnBurger) return; function handleMenuClick() { if (animationInProgress) return; animationInProgress = true; btnBurger.classList.toggle('opened'); offsetContainer.classList.toggle('slideIn'); const offMenu = document.getElementById('offMenu'); const offCategories = document.getElementById('offCategories'); if (offMenu) offMenu.style.display = 'block'; if (offCategories) offCategories.style.display = 'none'; setTimeout(function () { const menuItems = document.querySelectorAll('#menu-header-menu li'); menuItems.forEach(function (item, index) { setTimeout(function () { item.classList.toggle('fade-in-up'); if (index === menuItems.length - 1) { setTimeout(function () { const socials = document.getElementById('offSocials'); if (socials) socials.classList.toggle('fade-in-up'); }, 250); } }, index * 250); }); }, 350); menuLinks.forEach(function (link) { link.addEventListener('mouseenter', function () { this.classList.add('offActive'); menuLinks.forEach(function (otherLink) { if (otherLink !== link) otherLink.classList.add('offOut'); }); }); link.addEventListener('mouseleave', function () { this.classList.remove('offActive'); menuLinks.forEach(function (otherLink) { if (otherLink !== link) otherLink.classList.remove('offOut'); }); }); }); setTimeout(() => { animationInProgress = false; }, 600); } function handleCatClick() { if (animationInProgress) return; animationInProgress = true; btnBurger.classList.toggle('opened'); offsetContainer.classList.toggle('slideIn'); const offMenu = document.getElementById('offMenu'); const offCategories = document.getElementById('offCategories'); if (offMenu) offMenu.style.display = 'none'; if (offCategories) offCategories.style.display = 'block'; setTimeout(function () { const catItems = document.querySelectorAll('.wpr-taxonomy-list li'); catItems.forEach(function (item, index) { setTimeout(function () { item.classList.toggle('fade-in-up'); if (index === catItems.length - 1) { setTimeout(function () { const socials = document.getElementById('offSocials'); if (socials) socials.classList.toggle('fade-in-up'); }, 250); } }, index * 250); }); }, 350); catLinks.forEach(function (link) { link.addEventListener('mouseenter', function () { this.classList.add('offActive'); catLinks.forEach(function (otherLink) { if (otherLink !== link) otherLink.classList.add('offOut'); }); }); link.addEventListener('mouseleave', function () { this.classList.remove('offActive'); catLinks.forEach(function (otherLink) { if (otherLink !== link) otherLink.classList.remove('offOut'); }); }); }); setTimeout(() => { animationInProgress = false; }, 600); } function changeHeaderLogo(src) { const headerLogoImg = document.querySelector('#headerLogo img'); if (headerLogoImg) { headerLogoImg.srcset = src; } } function changeBurgerLineStyle(color) { const burgerLines = document.querySelectorAll('#btnBurger .line'); burgerLines.forEach(line => { line.style.stroke = color; }); } function handleSectionChange(currentSection) { btnBurger.removeEventListener('click', handleMenuClick); btnBurger.removeEventListener('click', handleCatClick); const imgLight = "/wp-content/uploads/2023/11/Asset-2.png"; switch (currentSection) { case 'pageSection1': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleMenuClick); if (ctaLink) { ctaLink.innerText = ''; ctaLink.href = ''; ctaLink.classList.remove('ctaShow'); } break; case 'pageSection2': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleCatClick); if (ctaLink) { ctaLink.innerText = 'VER DOCES CONVENTUAIS'; ctaLink.href = '/loja-online/?category=/conventuais/'; ctaLink.classList.add('ctaShow'); } break; case 'pageSection3': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleCatClick); if (ctaLink) { ctaLink.innerText = 'VER BOLACHAS E BROAS'; ctaLink.href = '/loja-online/?category=/bolachas-broas/'; ctaLink.classList.add('ctaShow'); } break; case 'pageSection4': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleCatClick); if (ctaLink) { ctaLink.innerText = 'VER MAIS PRODUTOS'; ctaLink.href = '/loja-online'; ctaLink.classList.add('ctaShow'); } break; case 'pageSection5': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleCatClick); if (ctaLink) { ctaLink.innerText = 'VER BOLACHAS E BROAS'; ctaLink.href = '/loja-online/?category=/bolachas-broas/'; ctaLink.classList.add('ctaShow'); } break; case 'pageSection6': changeHeaderLogo(imgLight); changeBurgerLineStyle("white"); btnBurger.addEventListener('click', handleCatClick); if (ctaLink) { ctaLink.innerText = ''; ctaLink.href = ''; ctaLink.classList.remove('ctaShow'); } break; default: btnBurger.addEventListener('click', handleMenuClick); break; } } const observer = new IntersectionObserver(entries => { entries.forEach(entry => { if (entry.isIntersecting) { handleSectionChange(entry.target.id); } }); }, { threshold: 0.5 }); const sections = ['pageSection1', 'pageSection2', 'pageSection3', 'pageSection4', 'pageSection5', 'pageSection6']; sections.forEach(sectionId => { const section = document.getElementById(sectionId); if (section) { observer.observe(section); } }); btnBurger.addEventListener('click', handleMenuClick); }); document.addEventListener('DOMContentLoaded', function () { const scrollButtons = document.querySelectorAll('.slideScroll'); if (!scrollButtons.length) return; scrollButtons.forEach(function (button, index) { button.addEventListener('click', function (e) { e.preventDefault(); const nextSectionId = 'pageSection' + (index + 2); const target = document.getElementById(nextSectionId); if (!target) return; target.scrollIntoView({ behavior: 'smooth', block: 'start' }); }); }); });
0
Carrinho (0)
Empty Cart Your Cart is Empty!

Parece que ainda não adicionou nenhum produto ao carrinho.

Ver Produtos
Subtotal
Portes & taxas calculadas no final da compra.
0,00 €
Finalizar Compra
Scroll to Top