Add base files for new Jekyll site setup
Introduced initial setup for a Jekyll-based site, including configurations, layouts, assets, and styles. Added custom 404 page, favicon assets, SCSS themes, fonts, and a blog post template to establish the foundation for the site.
This commit is contained in:
parent
6f1566716d
commit
0764cfc61d
57 changed files with 3564 additions and 0 deletions
assets/js
31
assets/js/main.js
Normal file
31
assets/js/main.js
Normal file
|
@ -0,0 +1,31 @@
|
|||
(() => {
|
||||
// Theme switch
|
||||
const body = document.body;
|
||||
const lamp = document.getElementById("mode");
|
||||
|
||||
const toggleTheme = (state) => {
|
||||
if (state === "dark") {
|
||||
localStorage.setItem("theme", "light");
|
||||
body.removeAttribute("data-theme");
|
||||
} else if (state === "light") {
|
||||
localStorage.setItem("theme", "dark");
|
||||
body.setAttribute("data-theme", "dark");
|
||||
} else {
|
||||
initTheme(state);
|
||||
}
|
||||
};
|
||||
|
||||
lamp.addEventListener("click", () =>
|
||||
toggleTheme(localStorage.getItem("theme"))
|
||||
);
|
||||
|
||||
// Blur the content when the menu is open
|
||||
const cbox = document.getElementById("menu-trigger");
|
||||
|
||||
cbox.addEventListener("change", function () {
|
||||
const area = document.querySelector(".wrapper");
|
||||
this.checked
|
||||
? area.classList.add("blurry")
|
||||
: area.classList.remove("blurry");
|
||||
});
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue