function fixHeight() { document.documentElement.style.setProperty('--vh', `${window.innerHeight}px`); } fixHeight(); window.addEventListener('resize', fixHeight);