mirror of
https://github.com/khairul169/honey.git
synced 2026-10-04 18:03:54 +07:00
settings: Add blur switch
This commit is contained in:
@@ -88,6 +88,7 @@ function load_config(conf) {
|
||||
load_apps();
|
||||
switch_theme(get_bool("dark_mode"));
|
||||
new_tab_toggle(get_bool("open_new_tab"));
|
||||
blur_toggle(get_bool("blur"));
|
||||
}
|
||||
|
||||
function is_secure(uri) {
|
||||
|
||||
+16
@@ -76,6 +76,22 @@ function new_tab_toggle(value) {
|
||||
load_apps();
|
||||
}
|
||||
|
||||
function blur_toggle(value) {
|
||||
let v = get_bool("blur");
|
||||
if (value === undefined) v = !v;
|
||||
config("blur", v);
|
||||
setting = get("setting-blur").classList;
|
||||
let body = document.body.classList;
|
||||
if (v) {
|
||||
setting.add("checked");
|
||||
body.remove("noblur");
|
||||
}
|
||||
else {
|
||||
setting.remove("checked");
|
||||
body.add("noblur");
|
||||
}
|
||||
}
|
||||
|
||||
function reset_all_settings() {
|
||||
if (check_cookies()) localStorage.clear();
|
||||
load_config(CONFIG_DEFAULT);
|
||||
|
||||
Reference in New Issue
Block a user