From 44c08baab756ae39e7f1671e19aaa2f9477fd30d Mon Sep 17 00:00:00 2001 From: Alan Date: Wed, 10 Jul 2024 00:29:11 +0400 Subject: [PATCH] Update full height elements when screen turned --- js/main.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/main.js b/js/main.js index 8d2e77f..aede2da 100644 --- a/js/main.js +++ b/js/main.js @@ -40,7 +40,7 @@ ready(() => { window.scrollTo(0, 0); // scroll to top on page load // set vh property to the true viewport height to fix it on mobile browsers - document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`); + document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`) // DISABLE RIGHT CLICK /* @@ -112,7 +112,9 @@ ready(() => { // fire when window resized, e.g. when device is turned window.addEventListener('resize', function(event) { intro = _('.content').offsetTop; // set top of content - + + document.documentElement.style.setProperty('--vh', `${window.innerHeight * 0.01}px`) + headerYOffset = (window.innerHeight)/10 - parseFloat(getComputedStyle(_("h2")).fontSize) - 5 updateHeaders() }, true);