-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
22 lines (21 loc) · 776 Bytes
/
script.js
File metadata and controls
22 lines (21 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Footer year
document.getElementById("yearNow").textContent = new Date().getFullYear();
// Timeline toggle: show only 2025 by default
const toggleBtn = document.getElementById("toggleYears");
let showAll = false;
toggleBtn.addEventListener("click", () => {
showAll = !showAll;
document.querySelectorAll("#timelineList .year-block").forEach((block) => {
const year = block.getAttribute("data-year");
if (showAll) {
block.classList.remove("hidden");
} else {
if (year !== "2025") {
block.classList.add("hidden");
} else {
block.classList.remove("hidden");
}
}
});
toggleBtn.textContent = showAll ? "올해만 보기" : "전체 연도 보기";
});