abdullahtarawneh.com/assets/js/main.js

10 lines
328 B
JavaScript
Raw Normal View History

2021-12-22 23:34:40 +00:00
var root = document.documentElement;
2021-12-22 23:14:41 +00:00
let vh = window.innerHeight * 0.01;
2021-12-22 23:34:40 +00:00
root.style.setProperty('--vh', `${vh}px`);
2021-12-22 23:14:41 +00:00
// We listen to the resize event
window.addEventListener('resize', () => {
// We execute the same script as before
2021-12-22 23:34:40 +00:00
let vh = window.innerHeight * 0.01;
root.style.setProperty('--vh', `${vh}px`);
2021-12-23 05:32:17 +00:00
});