mirror of
https://github.com/khairul169/honey.git
synced 2025-04-28 14:59:32 +07:00
settings: Add blur switch
This commit is contained in:
parent
76e071fec5
commit
cec930beaf
@ -7,6 +7,7 @@
|
|||||||
"wallpaper_dark": "img/background-dark.jpg",
|
"wallpaper_dark": "img/background-dark.jpg",
|
||||||
"dark_mode": false,
|
"dark_mode": false,
|
||||||
"open_new_tab": false,
|
"open_new_tab": false,
|
||||||
|
"blur": true,
|
||||||
"hosted_by": "somebody"
|
"hosted_by": "somebody"
|
||||||
},
|
},
|
||||||
"services": [
|
"services": [
|
||||||
|
11
css/main.css
11
css/main.css
@ -14,6 +14,7 @@ html {
|
|||||||
--bg2: #FFF8;
|
--bg2: #FFF8;
|
||||||
--hover: #0001;
|
--hover: #0001;
|
||||||
--scale-factor: 1.15;
|
--scale-factor: 1.15;
|
||||||
|
--blur: blur(16px);
|
||||||
}
|
}
|
||||||
|
|
||||||
body {
|
body {
|
||||||
@ -26,6 +27,10 @@ body {
|
|||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
-webkit-tap-highlight-color: transparent;
|
-webkit-tap-highlight-color: transparent;
|
||||||
}
|
}
|
||||||
|
.noblur {
|
||||||
|
--blur: blur(0);
|
||||||
|
}
|
||||||
|
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -128,7 +133,7 @@ a {
|
|||||||
box-shadow: 2px 2px 8px #0003;
|
box-shadow: 2px 2px 8px #0003;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
padding: 3px;
|
padding: 3px;
|
||||||
backdrop-filter: blur(16px);
|
backdrop-filter: var(--blur);
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
margin: -4px 12px 16px;
|
margin: -4px 12px 16px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -153,7 +158,7 @@ a {
|
|||||||
box-shadow: 2px 2px 8px #0002;
|
box-shadow: 2px 2px 8px #0002;
|
||||||
display: flex;
|
display: flex;
|
||||||
margin: 16px auto 0;
|
margin: 16px auto 0;
|
||||||
backdrop-filter: blur(16px);
|
backdrop-filter: var(--blur);
|
||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
max-width: 480px;
|
max-width: 480px;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
@ -184,7 +189,7 @@ a {
|
|||||||
border-radius: 24px;
|
border-radius: 24px;
|
||||||
background: var(--background);
|
background: var(--background);
|
||||||
margin: 20px;
|
margin: 20px;
|
||||||
backdrop-filter: blur(16px);
|
backdrop-filter: var(--blur);
|
||||||
transition: background .2s;
|
transition: background .2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,6 +106,14 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="switch"></div>
|
<div class="switch"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="setting" onclick="blur_toggle()" id="setting-blur">
|
||||||
|
<div class="icon">blur_on</div>
|
||||||
|
<div class="text">
|
||||||
|
<div class="name">Enable blur</div>
|
||||||
|
<div class="desc">Improves UI sweetness but has a huge impact on performance</div>
|
||||||
|
</div>
|
||||||
|
<div class="switch"></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -88,6 +88,7 @@ function load_config(conf) {
|
|||||||
load_apps();
|
load_apps();
|
||||||
switch_theme(get_bool("dark_mode"));
|
switch_theme(get_bool("dark_mode"));
|
||||||
new_tab_toggle(get_bool("open_new_tab"));
|
new_tab_toggle(get_bool("open_new_tab"));
|
||||||
|
blur_toggle(get_bool("blur"));
|
||||||
}
|
}
|
||||||
|
|
||||||
function is_secure(uri) {
|
function is_secure(uri) {
|
||||||
|
16
js/main.js
16
js/main.js
@ -76,6 +76,22 @@ function new_tab_toggle(value) {
|
|||||||
load_apps();
|
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() {
|
function reset_all_settings() {
|
||||||
if (check_cookies()) localStorage.clear();
|
if (check_cookies()) localStorage.clear();
|
||||||
load_config(CONFIG_DEFAULT);
|
load_config(CONFIG_DEFAULT);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user