52 lines
No EOL
1.2 KiB
JavaScript
52 lines
No EOL
1.2 KiB
JavaScript
import { headerToggle, headerScrollVisibility } from './header.js';
|
|
import { copyLink } from './share.js';
|
|
import { themeToggle } from './themeToggle.js';
|
|
import { playVideo } from './hero-video.js';
|
|
import { initDropdowns } from './dropdown.js';
|
|
import { initSwipers } from './swipers.js';
|
|
import { initSliderBeforeAfter } from './investigation.js';
|
|
|
|
const responsiveMedium = 1080;
|
|
const responsiveSmall = 768;
|
|
|
|
window.onload = async function () {
|
|
console.log("SCRIPT LOADED");
|
|
|
|
headerToggle();
|
|
themeToggle();
|
|
|
|
copyLink();
|
|
playVideo();
|
|
initDropdowns(responsiveSmall);
|
|
initSwipers();
|
|
|
|
initSliderBeforeAfter();
|
|
|
|
var elem = document.querySelector('.grid-masonry');
|
|
var msnry = null;
|
|
|
|
function initMasonry() {
|
|
if (!elem) return;
|
|
if (window.innerWidth >= responsiveSmall) {
|
|
if (!msnry) {
|
|
msnry = new Masonry(elem, {
|
|
itemSelector: '.card--impact',
|
|
columnWidth: '.grid-sizer',
|
|
percentPosition: true,
|
|
gutter: 26
|
|
});
|
|
}
|
|
} else {
|
|
if (msnry) {
|
|
msnry.destroy();
|
|
msnry = null;
|
|
}
|
|
}
|
|
}
|
|
|
|
initMasonry();
|
|
window.addEventListener('resize', initMasonry);
|
|
|
|
|
|
|
|
} |