index-main/assets/js/script.js

52 lines
1.2 KiB
JavaScript
Raw Normal View History

2026-01-06 13:57:45 +01:00
import { headerToggle, headerScrollVisibility } from './header.js';
import { copyLink } from './share.js';
2026-01-06 16:15:49 +01:00
import { themeToggle } from './themeToggle.js';
2026-01-08 16:09:58 +01:00
import { playVideo } from './hero-video.js';
2026-01-21 16:33:15 +01:00
import { initDropdowns } from './dropdown.js';
2026-01-29 20:57:17 +01:00
import { initSwipers } from './swipers.js';
2026-02-14 17:03:03 +01:00
import { initSliderBeforeAfter } from './investigation.js';
2026-01-06 13:57:45 +01:00
const responsiveMedium = 1080;
const responsiveSmall = 768;
2026-01-08 14:53:08 +01:00
window.onload = async function () {
2026-01-06 13:57:45 +01:00
console.log("SCRIPT LOADED");
2026-02-20 14:09:25 +01:00
2026-01-06 13:57:45 +01:00
headerToggle();
2026-01-06 16:15:49 +01:00
themeToggle();
2026-01-25 19:40:55 +01:00
copyLink();
2026-01-08 16:09:58 +01:00
playVideo();
2026-01-25 19:40:55 +01:00
initDropdowns(responsiveSmall);
2026-01-30 12:27:44 +01:00
initSwipers();
2026-02-09 14:45:33 +01:00
2026-02-14 17:03:03 +01:00
initSliderBeforeAfter();
2026-02-09 14:45:33 +01:00
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);
2026-01-06 13:57:45 +01:00
}