index-main/assets/js/script.js
Julie Blanc a1eda42d87
All checks were successful
Deploy / Deploy to Production (push) Successful in 13s
design bottom bar
2026-02-20 14:09:25 +01:00

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);
}