优化服务入口页面风格

This commit is contained in:
lwt
2026-05-08 23:08:01 +08:00
parent 8f063aa289
commit 9848a5cdb4
3 changed files with 522 additions and 281 deletions
+10
View File
@@ -1,5 +1,15 @@
const year = document.querySelector("#year");
const header = document.querySelector("[data-header]");
if (year) {
year.textContent = new Date().getFullYear();
}
if (header) {
const updateHeader = () => {
header.classList.toggle("is-scrolled", window.scrollY > 8);
};
updateHeader();
window.addEventListener("scroll", updateHeader, { passive: true });
}