8 lines
281 B
JavaScript
8 lines
281 B
JavaScript
// Fix for mobile viewport height with address bar
|
|
function setVh() {
|
|
const vh = window.innerHeight * 0.01;
|
|
document.documentElement.style.setProperty('--vh', `${vh}px`);
|
|
}
|
|
setVh();
|
|
window.addEventListener('resize', setVh);
|
|
window.addEventListener('orientationchange', setVh);
|