diff --git a/wiki/pages/home.html b/wiki/pages/home.html index 592a2e778cb1489af457bb5bd790e8818971c181..0103c40c6d36913c2c4fd55173089d0d6932a970 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);