abdullahtarawneh.com/assets/js/main.js
2021-12-22 23:32:17 -06:00

10 lines
No EOL
328 B
JavaScript

var root = document.documentElement;
let vh = window.innerHeight * 0.01;
root.style.setProperty('--vh', `${vh}px`);
// We listen to the resize event
window.addEventListener('resize', () => {
// We execute the same script as before
let vh = window.innerHeight * 0.01;
root.style.setProperty('--vh', `${vh}px`);
});