This commit is contained in:
0
assets/scripts/bigger-picture.min.js
vendored
Normal file → Executable file
0
assets/scripts/bigger-picture.min.js
vendored
Normal file → Executable file
0
assets/scripts/comments.js
Normal file → Executable file
0
assets/scripts/comments.js
Normal file → Executable file
0
assets/scripts/competency-status-board.js
Normal file → Executable file
0
assets/scripts/competency-status-board.js
Normal file → Executable file
0
assets/scripts/gallery-init.js
Normal file → Executable file
0
assets/scripts/gallery-init.js
Normal file → Executable file
0
assets/scripts/lunr.js
Normal file → Executable file
0
assets/scripts/lunr.js
Normal file → Executable file
0
assets/scripts/mermaid.min.js
vendored
Normal file → Executable file
0
assets/scripts/mermaid.min.js
vendored
Normal file → Executable file
0
assets/scripts/notes.js
Normal file → Executable file
0
assets/scripts/notes.js
Normal file → Executable file
0
assets/scripts/script.js
Normal file → Executable file
0
assets/scripts/script.js
Normal file → Executable file
0
assets/scripts/search.js
Normal file → Executable file
0
assets/scripts/search.js
Normal file → Executable file
0
assets/scripts/sitemap-interactive.js
Normal file → Executable file
0
assets/scripts/sitemap-interactive.js
Normal file → Executable file
0
assets/scripts/svg-pan-zoom.min.js
vendored
Normal file → Executable file
0
assets/scripts/svg-pan-zoom.min.js
vendored
Normal file → Executable file
0
assets/scripts/wird-tracker.js
Normal file → Executable file
0
assets/scripts/wird-tracker.js
Normal file → Executable file
@@ -151,36 +151,11 @@
|
||||
});
|
||||
}
|
||||
|
||||
function initModeToggle() {
|
||||
const root = document.documentElement;
|
||||
const button = document.getElementById("db-mode-toggle");
|
||||
const label = document.getElementById("db-mode-label");
|
||||
if (!root || !button) return;
|
||||
|
||||
const storageKey = "db-mode";
|
||||
const saved = localStorage.getItem(storageKey);
|
||||
|
||||
const setMode = (mode) => {
|
||||
const isRetro = mode === "retro";
|
||||
root.dataset.mode = isRetro ? "retro" : "normal";
|
||||
button.setAttribute("aria-pressed", String(isRetro));
|
||||
button.setAttribute("title", isRetro ? "Switch to normal mode" : "Switch to retro mode");
|
||||
if (label) label.textContent = isRetro ? "Normal mode" : "Retro mode";
|
||||
localStorage.setItem(storageKey, root.dataset.mode);
|
||||
};
|
||||
|
||||
setMode(saved === "retro" ? "retro" : "normal");
|
||||
button.addEventListener("click", () => {
|
||||
setMode(root.dataset.mode === "retro" ? "normal" : "retro");
|
||||
});
|
||||
}
|
||||
|
||||
function init() {
|
||||
updateGreeting();
|
||||
updateClock();
|
||||
updateStats();
|
||||
initCommandFilter();
|
||||
initModeToggle();
|
||||
|
||||
setInterval(updateClock, 1000);
|
||||
loadFeed("/blogs/blogs-list.html", "db-feed-blogs", 6, "/blogs");
|
||||
|
||||
Reference in New Issue
Block a user