diff --git a/themes/patek/assets/js/dark-mode.js b/themes/patek/assets/js/dark-mode.js new file mode 100644 index 0000000..ddaff24 --- /dev/null +++ b/themes/patek/assets/js/dark-mode.js @@ -0,0 +1,5 @@ +document.addEventListener("DOMContentLoaded", () => { + if (window.location.search.indexOf("darkmode=true") > -1) { + document.getElementById("content").classList.add("dark-mode"); + } +}); diff --git a/themes/patek/assets/js/darkMode.js b/themes/patek/assets/js/darkMode.js deleted file mode 100644 index 4ea4202..0000000 --- a/themes/patek/assets/js/darkMode.js +++ /dev/null @@ -1,5 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - if (window.location.search.indexOf("darkmode=true") > -1) { - document.getElementById("content").classList.add("dark-mode"); - } -}); \ No newline at end of file diff --git a/themes/patek/assets/js/header-link.js b/themes/patek/assets/js/header-link.js new file mode 100644 index 0000000..6e754d4 --- /dev/null +++ b/themes/patek/assets/js/header-link.js @@ -0,0 +1,10 @@ +document.addEventListener("DOMContentLoaded", () => { + const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6"); + headings.forEach(e => { + const a = document.createElement("a"); + a.href = "#" + e.id; + a.innerText = "#"; + a.classList.add("header-link"); + e.prepend(a); + }); +}); diff --git a/themes/patek/assets/js/headerLink.js b/themes/patek/assets/js/headerLink.js deleted file mode 100644 index 7f0d841..0000000 --- a/themes/patek/assets/js/headerLink.js +++ /dev/null @@ -1,10 +0,0 @@ -document.addEventListener("DOMContentLoaded", () => { - const headings = document.querySelectorAll(".content h1, .content h2, .content h3, .content h4, .content h5, .content h6"); - headings.forEach(e => { - const a = document.createElement("a"); - a.href = "#" + e.id; - a.innerText = "#"; - a.classList.add("header-link"); - e.prepend(a); - }); -}); \ No newline at end of file diff --git a/themes/patek/assets/js/home.js b/themes/patek/assets/js/home.js index a5c8c1c..1910a06 100644 --- a/themes/patek/assets/js/home.js +++ b/themes/patek/assets/js/home.js @@ -1,9 +1,9 @@ document.addEventListener("DOMContentLoaded", () => { - document.addEventListener("scroll", () => { - if (window.scrollY > document.querySelector("#home-navbar .menu-placeholder").offsetTop) { - document.getElementById("home-navbar").classList.add("is-fixed-top"); - } else { - document.getElementById("home-navbar").classList.remove("is-fixed-top"); - } - }); -}); \ No newline at end of file + document.addEventListener("scroll", () => { + if (window.scrollY > document.querySelector("#home-navbar .menu-placeholder").offsetTop) { + document.getElementById("home-navbar").classList.add("is-fixed-top"); + } else { + document.getElementById("home-navbar").classList.remove("is-fixed-top"); + } + }); +}); diff --git a/themes/patek/assets/js/patek-logo-custom-element b/themes/patek/assets/js/patek-logo-custom-element index 895805b..0a5cf14 160000 --- a/themes/patek/assets/js/patek-logo-custom-element +++ b/themes/patek/assets/js/patek-logo-custom-element @@ -1 +1 @@ -Subproject commit 895805bda1cfc4adc016826c79c400a6d8be6f34 +Subproject commit 0a5cf1419b3555f16a069eaa562ebb122b2f6f5d diff --git a/themes/patek/layouts/_default/baseof.html b/themes/patek/layouts/_default/baseof.html index fa71559..02e4206 100644 --- a/themes/patek/layouts/_default/baseof.html +++ b/themes/patek/layouts/_default/baseof.html @@ -11,9 +11,9 @@ {{- end }} {{ block "js" . -}} - {{ partial "js.html" "js/headerLink.js" }} - {{ partial "js.html" "js/patek-logo-custom-element/patekLogo.js" }} - {{ partial "js.html" "js/darkMode.js" }} + {{ partial "js.html" "js/header-link.js" }} + {{ partial "js.html" "js/patek-logo-custom-element/patek-logo.js" }} + {{ partial "js.html" "js/dark-mode.js" }} {{ end }} {{ block "body" . }}