summaryrefslogtreecommitdiffhomepage
path: root/js/parallax-header.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/parallax-header.js')
-rwxr-xr-xjs/parallax-header.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/js/parallax-header.js b/js/parallax-header.js
index c4ce1fc..52990f8 100755
--- a/js/parallax-header.js
+++ b/js/parallax-header.js
@@ -13,6 +13,7 @@ document.addEventListener("scroll", () => {
function animate() {
currentPercent += (targetPercent - currentPercent) * tweenSpeed;
+ currentPercent = Math.max(Math.min(targetMax, currentPercent), targetMin);
document.documentElement.style.setProperty('--scroll-percent', currentPercent + '%');
requestAnimationFrame(animate);
}