Skip to content

Commit

Permalink
Tweak behavior on short sections
Browse files Browse the repository at this point in the history
  • Loading branch information
alanrme committed Jun 30, 2024
1 parent cae01f4 commit 4045807
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ ready(() => {
// if the element is at the top of the screen
if (rect.top < 0) {
header.classList.add("sticky")
header.style.transform = `scale(10) translateX(${(rect.top) / (rect.bottom - rect.top - vh)*30}%)`
header.style.transform = `scale(10) translateX(${(rect.top) / (rect.bottom - rect.top)*70}%)`
} else {
header.classList.remove("sticky")
header.style.transform = null
Expand Down

0 comments on commit 4045807

Please sign in to comment.