Files
Modrinth-plus/static/js/main.js

16 lines
462 B
JavaScript
Raw Normal View History

2020-06-22 21:04:17 -07:00
window.onload = function () {
2020-06-25 22:40:29 -07:00
if (localStorage.getItem("data-theme")) {
document.documentElement.setAttribute("data-theme", localStorage.getItem("data-theme"));
2020-06-22 21:04:17 -07:00
}
2020-06-27 10:29:49 -07:00
}
2020-06-28 13:53:03 -07:00
function switchThemes() {
let switchTheme = localStorage.getItem("data-theme") === "light" ? "dark" : "light";
localStorage.setItem("data-theme", switchTheme);
document.documentElement.setAttribute("data-theme", switchTheme);
}
2020-06-27 10:29:49 -07:00
function closePopup(e) {
e.parentElement.outerHTML = "";
2020-06-22 21:48:42 -05:00
}