settings: Add animations switch

This commit is contained in:
Daniel
2023-05-09 22:20:11 +02:00
parent cec930beaf
commit a8e1c25394
5 changed files with 29 additions and 0 deletions
+1
View File
@@ -89,6 +89,7 @@ function load_config(conf) {
switch_theme(get_bool("dark_mode"));
new_tab_toggle(get_bool("open_new_tab"));
blur_toggle(get_bool("blur"));
animations(get_bool("animations"));
}
function is_secure(uri) {
+16
View File
@@ -92,6 +92,22 @@ function blur_toggle(value) {
}
}
function animations(value) {
let v = get_bool("animations");
if (value === undefined) v = !v;
config("animations", v);
setting = get("setting-animations").classList;
let body = document.body.classList;
if (v) {
setting.add("checked");
body.remove("noanim");
}
else {
setting.remove("checked");
body.add("noanim");
}
}
function reset_all_settings() {
if (check_cookies()) localStorage.clear();
load_config(CONFIG_DEFAULT);