mirror of
https://github.com/khairul169/honey.git
synced 2026-10-04 18:03:54 +07:00
settings: Add animations switch
This commit is contained in:
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user