E:
/
home
/
kbcomunicacao1
/
Web
/
berenice
/
assets
/
js
/
Upload File
HOME
"use strict"; /* ======= Header animation ======= */ const topBar = document.getElementById('topbar'); window.onload=function() { headerAnimation(); }; window.onresize=function() { headerAnimation(); }; window.onscroll=function() { headerAnimation(); }; function headerAnimation () { var scrollTop = window.scrollY; if ( scrollTop > 0 ) { header.classList.add('topbar-scrolled'); } else { header.classList.remove('topbar-scrolled'); } }; /* ===== Smooth scrolling ====== */ /* Note: You need to include smoothscroll.min.js (smooth scroll behavior polyfill) on the page to cover some browsers */ /* Ref: https://github.com/iamdustan/smoothscroll */ let scrollLinks = document.querySelectorAll('.scrollto'); const pageNavWrapper = document.getElementById('navbar-collapse'); scrollLinks.forEach((scrollLink) => { scrollLink.addEventListener('click', (e) => { e.preventDefault(); let element = document.querySelector(scrollLink.getAttribute("href")); const yOffset = 50; //page .header height //console.log(yOffset); const y = element.getBoundingClientRect().top + window.pageYOffset - yOffset; window.scrollTo({top: y, behavior: 'smooth'}); //Collapse mobile menu after clicking if (pageNavWrapper.classList.contains('show')){ pageNavWrapper.classList.remove('show'); } }); }); /* ===== Gumshoe SrollSpy ===== */ /* Ref: https://github.com/cferdinandi/gumshoe */ // Initialize Gumshoe var spy = new Gumshoe('.main-nav .nav-link', { offset: 50 }); /* ==== Vanilla JS Back To Top Widget ====== */ /* Ref: https://github.com/vfeskov/vanilla-back-to-top */ addBackToTop({ cornerOffset: 15, // px id:'back-to-top', }); /* ===== Tinyslider ====== */ /* Ref: https://github.com/ganlanyuan/tiny-slider */ const slider = tns({ container: '#reviews-carousel', loop: true, items: 3, responsive: { 0: { items: 1 }, 576:{ items:2 }, 992:{ items:3 }, }, slideBy: 'page', nav: true, autoplay: true, autoplayButtonOutput: false, mouseDrag: true, lazyload: true, gutter: 15, navPosition: 'bottom', controls: false, speed: 800, }); /* ====== SimpleLightbox Plugin ======= */ /* Ref: https://github.com/andreknieriem/simplelightbox */ var lightbox = new SimpleLightbox('.simplelightbox-gallery a', {/* options */});