From ef6d0321065ce2cb3d38551288d5c8d082dae524 Mon Sep 17 00:00:00 2001 From: Nickiel12 Date: Sat, 18 Nov 2023 21:17:38 -0800 Subject: [PATCH] removed jquery --- themes/NSP/assets/js/main.js | 2 +- themes/NSP/layouts/_default/baseof.html | 2 +- themes/NSP/layouts/partials/head.html | 1 - themes/NSP/static/navbar.js | 23 ++++++----------------- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/themes/NSP/assets/js/main.js b/themes/NSP/assets/js/main.js index 603e889..65cc08c 100644 --- a/themes/NSP/assets/js/main.js +++ b/themes/NSP/assets/js/main.js @@ -1 +1 @@ -console.log('This site was generated by Hugo. Test'); +// console.log('This site was generated by Hugo. Test'); diff --git a/themes/NSP/layouts/_default/baseof.html b/themes/NSP/layouts/_default/baseof.html index ce9613a..aa5aefb 100644 --- a/themes/NSP/layouts/_default/baseof.html +++ b/themes/NSP/layouts/_default/baseof.html @@ -3,7 +3,7 @@ {{ partial "head.html" . }} - +
{{ partial "header.html" . }}
diff --git a/themes/NSP/layouts/partials/head.html b/themes/NSP/layouts/partials/head.html index 83f4d09..cff964b 100644 --- a/themes/NSP/layouts/partials/head.html +++ b/themes/NSP/layouts/partials/head.html @@ -1,7 +1,6 @@ {{ if .IsHome }}{{ site.Title }}{{ else }}{{ printf "%s | %s" .Title site.Title }}{{ end }} - diff --git a/themes/NSP/static/navbar.js b/themes/NSP/static/navbar.js index fc6e641..e9ebbf1 100644 --- a/themes/NSP/static/navbar.js +++ b/themes/NSP/static/navbar.js @@ -1,27 +1,16 @@ -$(document).ready(function() { - light_mode(); -}) function light_mode() { - console.log("light mode!"); - $("body").removeClass("darkmode").removeClass("sunsetmode").addClass("lightmode"); - $("body").find("*").each(function () { - $(this).removeClass("darkmode").removeClass("sunsetmode").addClass("lightmode"); - }) + document.body.className = document.body.className.replace("darkmode", "").replace("sunsetmode", "").replace("lightmode", ""); + document.body.className += " lightmode"; } function sunset_mode() { - console.log("sunset mode!"); - $("body").removeClass("lightmode").removeClass("darkmode").addClass("sunsetmode"); - $("body").find("*").each(function () { - $(this).removeClass("lightmode").removeClass("darkmode").addClass("sunsetmode"); - }) + document.body.className = document.body.className.replace("darkmode", "").replace("sunsetmode", "").replace("lightmode", ""); + document.body.className += " sunsetmode"; } function dark_mode() { - $("body").removeClass("lightmode").removeClass("sunsetmode").addClass("darkmode"); - $("body").find("*").each(function () { - $(this).removeClass("lightmode").removeClass("sunsetmode").addClass("darkmode"); - }) + document.body.className = document.body.className.replace("darkmode", "").replace("sunsetmode", "").replace("lightmode", ""); + document.body.className += " darkmode"; }