var html = document.documentElement; var body = document.body; var timeout; var st = 0; cover(); featured(); pagination(false); window.addEventListener('scroll', function () { 'use strict'; if (body.classList.contains('home-template') && body.classList.contains('with-full-cover') && !document.querySelector('.cover').classList.contains('half')) { if (timeout) { window.cancelAnimationFrame(timeout); } timeout = window.requestAnimationFrame(portalButton); } }); if (document.querySelector('.cover') && document.querySelector('.cover').classList.contains('half')) { body.classList.add('portal-visible'); } function portalButton() { 'use strict'; st = window.scrollY; if (st > 300) { body.classList.add('portal-visible'); } else { body.classList.remove('portal-visible'); } } function cover() { 'use strict'; var cover = document.querySelector('.cover'); if (!cover) return; imagesLoaded(cover, function () { cover.classList.remove('image-loading'); }); document.querySelector('.cover-arrow').addEventListener('click', function () { var element = cover.nextElementSibling; element.scrollIntoView({behavior: 'smooth', block: 'start'}); }); } function featured() { 'use strict'; var feed = document.querySelector('.featured-feed'); if (!feed) return; tns({ container: feed, controlsText: [ '', '', ], gutter: 30, loop: false, nav: false, responsive: { 0: { items: 1, }, 768: { items: 2, }, 992: { items: 3, }, }, }); }