30 lines
1 KiB
JavaScript
30 lines
1 KiB
JavaScript
initLangSwitch();
|
|
initTheme();
|
|
|
|
function syncTaglineFit(){
|
|
const heroBrandInner = document.getElementById('heroBrandInner');
|
|
const logo = heroBrandInner?.querySelector('.logo');
|
|
const tagline = heroBrandInner?.querySelector('.tagline');
|
|
if (!logo || !tagline) return;
|
|
|
|
document.documentElement.style.setProperty('--hero-tagline-fit', '1');
|
|
const logoW = logo.getBoundingClientRect().width;
|
|
const taglineW = tagline.scrollWidth;
|
|
const fit = taglineW > 0 ? Math.min(1, logoW / taglineW) : 1;
|
|
document.documentElement.style.setProperty('--hero-tagline-fit', fit.toFixed(4));
|
|
}
|
|
|
|
initHeroScroll({
|
|
section: document.querySelector('.hero'),
|
|
stage: document.querySelector('.hero-stage'),
|
|
brand: document.querySelector('.hero-brand'),
|
|
brandInner: document.getElementById('heroBrandInner'),
|
|
mobileAnimClass: 'hero--mobile-anim',
|
|
scrollDrivenClass: 'hero--scroll-driven',
|
|
brandScaleAnimation: 'hero-brand-scale',
|
|
syncFit: syncTaglineFit,
|
|
subtractRunwayOnMobile: false
|
|
});
|
|
|
|
initReveal();
|
|
initContactForm();
|