Skip to content

Commit bb41779

Browse files
committed
fix bugs in settings
1 parent 36e6de3 commit bb41779

File tree

15 files changed

+195
-30
lines changed

15 files changed

+195
-30
lines changed

src/assets/backgrounds/bg-1.jpg

-6.96 MB
Binary file not shown.

src/assets/backgrounds/bg-1.png

983 KB
Loading

src/assets/backgrounds/bg-2.jpg

-16.6 MB
Binary file not shown.

src/assets/backgrounds/bg-2.png

1.68 MB
Loading

src/assets/backgrounds/bg-3.jpg

-4.65 MB
Binary file not shown.

src/assets/backgrounds/bg-3.png

586 KB
Loading

src/pages/dashboard.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,19 @@
1616
</div>
1717
<!-- MENU LIST -->
1818
<div class="menu-list hide">
19-
<button class="active-sec"><i data-icon="note"></i>Stick Wall</button>
19+
<button class="active-sec"><i data-icon="note"></i>
20+
<p class="nav-btn-text">Stick Wall</p>
21+
</button>
2022
</div>
2123
</div>
2224
<!-- MENU ACTIONS -->
2325
<div class="menu-actions hide">
24-
<button class="active"><i data-icon="setting"></i> Setting</button>
25-
<button><i data-icon="logout"></i> Logout</button>
26+
<button class="active"><i data-icon="setting"></i>
27+
<p class="nav-btn-text">Setting</p>
28+
</button>
29+
<button><i data-icon="logout"></i>
30+
<p class="nav-btn-text">Logout</p>
31+
</button>
2632
</div>
2733
</header>
2834
</div>
@@ -41,7 +47,7 @@ <h1 class="dashboard-title-page">Stick Wall</h1>
4147
</ul>
4248
</form>
4349
<!-- DASHBOARD CONTENT RIGHT -->
44-
<div class="dashboard-content_right-conatiner">
50+
<div class="dashboard-content_right-container">
4551
<section class="dashboard-content_right">
4652
<div class="dashboard-content_right-header">
4753
<h2>title</h2>

src/script/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function loadUserData() {
1818

1919
function loadAppMode() {
2020
if (localStorage.getItem('settings')) {
21-
document.body.classList.add(JSON.parse(localStorage['settings']).mode);
21+
document.body.classList.add(JSON.parse(localStorage['settings'])?.mode);
2222
}
2323
}
2424

src/script/pagesFunc/dashboard/dashboard.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,26 @@ export default function init() {
2121
if (dashboardPage.classList.toggle('act-menu_dashboard')) {
2222
localStorage.setItem('menu_state', 'false');
2323
dashboardPage?.classList.remove('act-content_dashboard-right');
24+
toggleCheckBlur();
2425
} else {
2526
localStorage.setItem('menu_state', 'true');
2627
}
2728

2829
applyBlurEffect();
2930
});
3031

32+
document.addEventListener('navBlur', toggleCheckBlur);
33+
function toggleCheckBlur() {
34+
if (!localStorage.getItem('settings')) return;
35+
if (JSON.parse(localStorage['settings']).background) {
36+
dashboardPage?.firstElementChild.firstElementChild.classList.add('check-blur');
37+
} else {
38+
dashboardPage?.firstElementChild.firstElementChild.classList.remove('check-blur');
39+
}
40+
}
41+
42+
toggleCheckBlur();
43+
3144
function loadMenuState() {
3245
if (!localStorage['menu_state']) return;
3346
const menuState = JSON.parse(localStorage['menu_state']);
@@ -68,7 +81,7 @@ export default function init() {
6881
if (!(dashboardPage instanceof HTMLElement)) return;
6982
if (!localStorage.getItem('settings')) return;
7083
const settings = JSON.parse(localStorage['settings']);
71-
dashboardPage.style.background = `url(${settings.background}) no-repeat center / cover fixed`;
84+
dashboardPage.style.background = `url(${settings?.background}) no-repeat center / cover fixed`;
7285
}
7386

7487
loadBackground();

src/script/pagesFunc/dashboard/dashboardHelpers.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function applyBlurEffect(cb) {
1111
`)
1212
.forEach((ele, ind) => {
1313
if (localStorage.getItem('settings')) {
14-
if ((JSON.parse(localStorage['settings']).background === null)) return;
14+
if ((JSON.parse(localStorage['settings'])?.background === null)) return;
1515
ele.classList.add('bg-blur');
1616

1717
if (localStorage.getItem('menu_state')) {

0 commit comments

Comments
 (0)