document.addEventListener("DOMContentLoaded", function () { el_autohide = document.querySelector('.fixed-top'); if (el_autohide) { var last_scroll_top = 0; var navbar_height = document.querySelector('.navbar').offsetHeight; window.addEventListener('scroll', function () { let scroll_top = window.scrollY; if (scroll_top < last_scroll_top) { el_autohide.classList.remove('cc-scrolled-down'); el_autohide.classList.add('cc-scrolled-up'); } else { el_autohide.classList.remove('cc-scrolled-up'); el_autohide.classList.add('cc-scrolled-down'); } if (scroll_top < navbar_height) { el_autohide.classList.remove('cc-white-header'); el_autohide.classList.add('cc-transparent-header'); } else { el_autohide.classList.remove('cc-transparent-header'); el_autohide.classList.add('cc-white-header'); } last_scroll_top = scroll_top; }); // window.addEventListener } explorar = document.querySelector('.cc-btn-explorar'); if (explorar) { let top = document.querySelector('.cc-cover').offsetHeight; explorar.onclick = function(){ window.scrollTo(0,top); }; } indice = document.getElementById('indice'); if (indice){ var itemModal = document.getElementById('cc-item-modal') itemModal.addEventListener('show.bs.modal', function (event) { // Button that triggered the modal var trigger = event.relatedTarget // Extract info from data-bs-* attributes var content = trigger.getAttribute('data-bs-content') // If necessary, you could initiate an AJAX request here // and then do the updating in a callback. // // Update the modal's content. var modalTitle = itemModal.querySelector('.modal-header h4') var modalBody = itemModal.querySelector('.modal-body') modalTitle.textContent = trigger.textContent modalBody.innerHTML = document.getElementById(content).innerHTML }); } const carousels = document.querySelectorAll('.carousel'); for (const carousel of carousels) { carousel = new bootstrap.Carousel(this) } }); // DOMContentLoaded end