Skip to content

Commit

Permalink
Update full height elements when screen turned
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrme committed Jul 9, 2024
1 parent 34d8cb4 commit 44c08ba
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
/*
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 44c08ba

Please sign in to comment.