From 4fceb136df160d5a6a03fb42e742d9aecca181a7 Mon Sep 17 00:00:00 2001 From: HouTeng Chan <ht-chen21@mails.tsinghua.edu.cn> Date: Mon, 30 Sep 2024 05:52:18 +0000 Subject: [PATCH] Update file home.html --- wiki/pages/home.html | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wiki/pages/home.html b/wiki/pages/home.html index 592a2e77..0103c40c 100644 --- a/wiki/pages/home.html +++ b/wiki/pages/home.html @@ -354,7 +354,7 @@ </body> <script> - // 颜色æ¸å˜å‡½æ•° + // 颜色æ¸å˜ function interpolateColor(color1, color2, factor) { const r1 = parseInt(color1.substring(1, 3), 16); const g1 = parseInt(color1.substring(3, 5), 16); @@ -368,17 +368,14 @@ return `#${r.toString(16).padStart(2, '0')}${g.toString(16).padStart(2, '0')}${b.toString(16).padStart(2, '0')}`; } - // 滚动事件处ç†å‡½æ•° function handleScroll() { const scrollPosition = window.scrollY; const documentHeight = document.documentElement.scrollHeight - window.innerHeight; const scrollPercentage = scrollPosition / documentHeight; - // å‡è®¾æ¯ä¸ªå†…容å—的高度大约是视å£é«˜åº¦çš„1.5å€ const cycleLength = window.innerHeight * 1.5; const cyclePosition = (scrollPosition % cycleLength) / cycleLength; - // 使用æ£å¼¦å‡½æ•°åˆ›å»ºå¹³æ»‘的周期性å˜åŒ– const factor = (Math.sin(cyclePosition * Math.PI * 2) + 1) / 2; const color = interpolateColor("#FFFFFF", "#FFE4E1", factor); -- GitLab