let fullShortsOpenReduzido = false let shortsContainerReduzido = document.querySelector('.ib-shortsReduzido') let closeBtnShortsFullReduzido = document.querySelector('.ib-shortsReduzidoClose') if(shortsContainerReduzido){ for (var x of document.querySelectorAll(".splide.shortsReduzido")) { var splide = new Splide(x, { perPage: 3, gap: 15, breakpoints: { 700: { perPage: 1 }, }, }); splide.mount(); x.style.display = "inherit"; } function openShortsReduzido(that) { if (!fullShortsOpenReduzido) { shortsContainerReduzido.classList.add('full') shortsContainerReduzido.querySelector('.splide__pagination').remove() for (var x of document.querySelectorAll(".splide.shortsReduzido")) { var splide = new Splide(x, { perPage: 4, gap: 30, breakpoints: { 1200: { perPage: 3 }, 900: { perPage: 2, }, 700: { perPage: 1, gap: 20 }, }, }); splide.mount(); x.style.display = "inherit"; } fullShortsOpenReduzido = true } let iframe = that.nextElementSibling iframe.src = iframe.getAttribute('data-src') that.classList.add("fade-out"); setTimeout(() => { that.classList.remove("fade-out"); that.style.display = 'none' }, 500); document.querySelector('body').classList.remove('stopScroll') } } if(closeBtnShortsFullReduzido){ closeBtnShortsFullReduzido.addEventListener('click', () => { shortsContainerReduzido.classList.remove('full') shortsContainerReduzido.querySelector('.splide__pagination').remove() for (var x of document.querySelectorAll(".splide.shortsReduzido")) { var splide = new Splide(x, { perPage: 2, gap: 14, breakpoints: { 700: { perPage: 1 }, }, }); splide.mount(); x.style.display = "inherit"; } document.querySelector('body').classList.remove('stopScroll') fullShortsOpenReduzido = false }) }