Files
heicode-win/website/js/main.js
T
gongzhiyong ca6289fab4 feat: 静态官网与 Docker Compose 本地部署
- website: 单页落地(愿景、架构、路径、团队范式、生命周期)
- nginx:alpine 镜像与 docker-compose(端口 8888)

Made-with: Cursor
2026-04-30 00:38:58 +08:00

17 lines
508 B
JavaScript

(() => {
const year = document.querySelector("[data-year]");
if (year) year.textContent = String(new Date().getFullYear());
document.querySelectorAll('a[href^="#"]').forEach((anchor) => {
anchor.addEventListener("click", (e) => {
const id = anchor.getAttribute("href");
if (!id || id === "#") return;
const el = document.querySelector(id);
if (el) {
e.preventDefault();
el.scrollIntoView({ behavior: "smooth", block: "start" });
}
});
});
})();