2022-02-10 16:06:55 +01:00
|
|
|
import $ from "jquery";
|
|
|
|
|
|
|
|
import {localstorage} from "./localstorage";
|
|
|
|
import {page_params} from "./page_params";
|
|
|
|
|
|
|
|
export function enable() {
|
2022-11-25 21:55:06 +01:00
|
|
|
$(":root").removeClass("color-scheme-automatic").addClass("dark-theme");
|
2022-02-10 16:06:55 +01:00
|
|
|
|
|
|
|
if (page_params.is_spectator) {
|
|
|
|
const ls = localstorage();
|
|
|
|
ls.set("spectator-theme-preference", "dark");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function disable() {
|
2022-11-25 21:55:06 +01:00
|
|
|
$(":root").removeClass("color-scheme-automatic").removeClass("dark-theme");
|
2022-02-10 16:06:55 +01:00
|
|
|
|
|
|
|
if (page_params.is_spectator) {
|
|
|
|
const ls = localstorage();
|
|
|
|
ls.set("spectator-theme-preference", "light");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export function default_preference_checker() {
|
2022-11-25 21:55:06 +01:00
|
|
|
$(":root").removeClass("dark-theme").addClass("color-scheme-automatic");
|
2022-02-10 16:06:55 +01:00
|
|
|
}
|