mirror of
https://github.com/khairul169/honey.git
synced 2025-04-28 14:59:32 +07:00
settings: Add animations switch
This commit is contained in:
parent
cec930beaf
commit
a8e1c25394
@ -8,6 +8,7 @@
|
||||
"dark_mode": false,
|
||||
"open_new_tab": false,
|
||||
"blur": true,
|
||||
"animations": true,
|
||||
"hosted_by": "somebody"
|
||||
},
|
||||
"services": [
|
||||
|
@ -30,6 +30,9 @@ body {
|
||||
.noblur {
|
||||
--blur: blur(0);
|
||||
}
|
||||
.noanim * {
|
||||
transition: none !important;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
display: none;
|
||||
|
@ -114,6 +114,14 @@
|
||||
</div>
|
||||
<div class="switch"></div>
|
||||
</div>
|
||||
<div class="setting" onclick="animations()" id="setting-animations">
|
||||
<div class="icon">animation</div>
|
||||
<div class="text">
|
||||
<div class="name">Animations</div>
|
||||
<div class="desc">Show nice and fancy page transitions, improves experience</div>
|
||||
</div>
|
||||
<div class="switch"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -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
js/main.js
16
js/main.js
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user