fix(feat): Refine responsive layout and section spacing

This commit is contained in:
SeekingGamer
2026-05-15 17:44:31 +08:00
parent ff7e4395ea
commit c09ba76350
19 changed files with 686 additions and 77 deletions

View File

@@ -33,7 +33,9 @@ const {
const getOffset = () => header ? header.offsetHeight : 0;
let activeScrollAnimation = 0;
const easeInCubic = (t: number) => t * t * t;
const easeInOutCubic = (t: number) => (
t < 0.5 ? 4 * t * t * t : 1 - Math.pow(-2 * t + 2, 3) / 2
);
const animateScrollTo = (targetTop: number) => {
const startTop = window.scrollY;
@@ -54,7 +56,7 @@ const {
const step = (now: number) => {
const elapsed = now - startTime;
const progress = Math.min(elapsed / duration, 1);
const easedProgress = easeInCubic(progress);
const easedProgress = easeInOutCubic(progress);
window.scrollTo(0, startTop + distance * easedProgress);
@@ -77,6 +79,7 @@ const {
e.preventDefault();
const top = target.getBoundingClientRect().top + window.scrollY - getOffset();
animateScrollTo(top);
history.pushState(null, '', href);
});
});