pianello-api/resources/js/components/dark-mode-switcher/index.js
Ale Gallo 82f958e5da Committing laravel (part 3)
committing js templating files and components
2023-11-10 16:00:59 +01:00

17 lines
490 B
JavaScript

(function () {
"use strict";
// Dark mode switcher
$(".dark-mode-switcher").on("click", function () {
if ($(this).hasClass("dark-mode-switcher--active")) {
$(this).removeClass("dark-mode-switcher--active");
} else {
$(this).addClass("dark-mode-switcher--active");
}
setTimeout(() => {
const link = $(".dark-mode-switcher").data("url");
window.location.href = link;
}, 500);
});
})();