feat: redesign website homepage

This commit is contained in:
Vinta Chen
2026-03-22 07:54:14 +08:00
parent 15b0ff3b07
commit 7d1d9e0af3
4 changed files with 1116 additions and 573 deletions

View File

@@ -10,6 +10,37 @@ var rows = document.querySelectorAll('.table tbody tr.row');
var tags = document.querySelectorAll('.tag');
var tbody = document.querySelector('.table tbody');
function initRevealSections() {
var sections = document.querySelectorAll('[data-reveal]');
if (!sections.length) return;
if (!('IntersectionObserver' in window)) {
sections.forEach(function (section) {
section.classList.add('is-visible');
});
return;
}
var observer = new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
if (!entry.isIntersecting) return;
entry.target.classList.add('is-visible');
observer.unobserve(entry.target);
});
}, {
threshold: 0.12,
rootMargin: '0px 0px -8% 0px',
});
sections.forEach(function (section, index) {
section.classList.add('will-reveal');
section.style.transitionDelay = Math.min(index * 70, 180) + 'ms';
observer.observe(section);
});
}
initRevealSections();
// Relative time formatting
function relativeTime(isoStr) {
var date = new Date(isoStr);
@@ -293,7 +324,7 @@ if (backToTop) {
}
});
backToTop.addEventListener('click', function () {
window.scrollTo({ top: 0 });
window.scrollTo({ top: 0, behavior: 'smooth' });
});
}

File diff suppressed because it is too large Load Diff