refactor : merge light-mode into script.js, rename panel to side-panel, fix print styles
All checks were successful
Deploy / Deploy to Production (push) Successful in 6s

Integrate light-mode.js into script.js, unify .panel/.side-panel classes
into .side-panel, scope theme variables to @media screen for proper
print light mode, and add page-break after chapo.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
isUnknown 2026-03-28 10:59:10 +01:00
parent a2e65635fb
commit a352c48eaa
8 changed files with 62 additions and 71 deletions

View file

@ -149,24 +149,24 @@ function subscribe(event) {
}
}
const panels = document.querySelectorAll(".panel[data-panel]");
const panels = document.querySelectorAll(".side-panel[data-panel]");
const navOverlay = document.querySelector("#nav-overlay");
function closeAllPanels() {
panels.forEach(panel => panel.classList.remove("panel--visible"));
panels.forEach(panel => panel.classList.remove("side-panel--visible"));
navOverlay.classList.remove("nav-overlay--visible");
document.body.classList.remove("no-scroll");
}
function openPanel(name, view) {
const panel = document.querySelector(`.panel[data-panel="${name}"]`);
const panel = document.querySelector(`.side-panel[data-panel="${name}"]`);
if (panel) {
if (view) {
panel.querySelectorAll('[data-view]').forEach(v => v.classList.add('hidden'));
const target = panel.querySelector(`[data-view="${view}"]`);
if (target) target.classList.remove('hidden');
}
panel.classList.add("panel--visible");
panel.classList.add("side-panel--visible");
navOverlay.classList.add("nav-overlay--visible");
document.body.classList.add("no-scroll");
}
@ -210,7 +210,7 @@ document.addEventListener("DOMContentLoaded", () => {
const navSortBtns = document.querySelectorAll(".side-panel .sort-btn");
const navSections = document.querySelectorAll(
".panel__all-texts, .panel__collection"
".side-panel__all-texts, .side-panel__collection"
);
navSortBtns.forEach((sortBtn) => {
@ -219,9 +219,9 @@ document.addEventListener("DOMContentLoaded", () => {
sortBtn.classList.add("active");
const sections = {
"sort-btn--all": ".panel__all-texts",
"sort-btn--years": ".panel__collection--years",
"sort-btn--categories": ".panel__collection--categories",
"sort-btn--all": ".side-panel__all-texts",
"sort-btn--years": ".side-panel__collection--years",
"sort-btn--categories": ".side-panel__collection--categories",
};
navSections.forEach((navSection) => navSection.classList.add("hidden"));
@ -240,7 +240,7 @@ document.addEventListener("DOMContentLoaded", () => {
});
});
document.querySelectorAll(".panel-close").forEach((btn) => {
document.querySelectorAll(".side-panel-close").forEach((btn) => {
btn.addEventListener("click", closeAllPanels);
});