Newer
Older
pre-www / src / assets / js / blocks / cards-grid.js
@EcosistemaWebIuav EcosistemaWebIuav on 15 Apr 662 bytes feat: homepage, sitemap, blocco alert,
window.addEventListener('load', (event) => {

    const cards = document.querySelectorAll('.card-grid-item')
    cards.forEach(card => {
        const marqueeWrapper = card.closest('.block-marquee-posts-row')
        card.addEventListener('mouseenter', function(){
            this.classList.add('is-hovered')
            if (marqueeWrapper){
                marqueeWrapper.classList.add('is-hovered')
            }
        })
        card.addEventListener('mouseleave', function(){
            this.classList.remove('is-hovered')
            if (marqueeWrapper){
                marqueeWrapper.classList.remove('is-hovered')
            }
        })
    })

})