From: Michael Orlitzky Date: Thu, 11 Sep 2025 01:59:56 +0000 (-0400) Subject: index.html.in: use classList for the night/day toggle X-Git-Url: http://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=11174cc75654183e1d7cc7b3511025f4b0205dca;p=charm-bypass.git index.html.in: use classList for the night/day toggle This is a little bit more robust than simply declaring that the sky element will never have any other classes. --- diff --git a/index.html.in b/index.html.in index 244f742..e2b4b2a 100644 --- a/index.html.in +++ b/index.html.in @@ -771,11 +771,11 @@ function swap_day_night() { const sky = document.getElementById("sky"); - if (sky.getAttribute("class") == "night") { - sky.setAttribute("class", ""); + if (sky.classList.contains("night")) { + sky.classList.remove("night"); } else { - sky.setAttribute("class", "night"); + sky.classList.add("night"); } }