Skip to content

Commit

Permalink
various improvemtnt
Browse files Browse the repository at this point in the history
  • Loading branch information
charandeepsinghb committed Dec 27, 2024
1 parent 7700a9c commit 5dd6e17
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 14 deletions.
5 changes: 5 additions & 0 deletions components/menu/menu.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,11 @@
background-color: var(--background-color);
}

.dark-mode .menu {
color: var(--dark-font-color);
background-color: var(--dark-background-color);
}

.menuClose {
opacity: 0;
scale: 0;
Expand Down
2 changes: 1 addition & 1 deletion dist/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libs/background-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function resetBackgroundColorListner(backgroundColorbox) {

backgroundResetIcon.addEventListener("click", ()=>{
document.documentElement.style.setProperty('--background-color', WHITE);
removeLocalStorageItem(BACKGROUND_COLOR);
setBackgroundColorbox(backgroundColorbox, WHITE);
setLocalStorageItem(BACKGROUND_COLOR, WHITE);
});
}

Expand Down
10 changes: 6 additions & 4 deletions libs/dark-colors-mode.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,15 @@ const BLACK = '#000000';

function toggleDarkMode(isOn) {
if (isOn) {
document.documentElement.style.setProperty('--font-color', DARK_TEXT_COLOR);
document.documentElement.style.setProperty('--background-color', DARK_BACKGROUND_COLOR);
// document.documentElement.style.setProperty('--font-color', DARK_TEXT_COLOR);
// document.documentElement.style.setProperty('--background-color', DARK_BACKGROUND_COLOR);
document.body.classList.add("dark-mode");
return;
}

document.documentElement.style.setProperty('--font-color', BLACK);
document.documentElement.style.setProperty('--background-color', WHITE);
// document.documentElement.style.setProperty('--font-color', BLACK);
// document.documentElement.style.setProperty('--background-color', WHITE);
document.body.classList.remove("dark-mode");
}

/*********************** Theme *************************/
Expand Down
2 changes: 1 addition & 1 deletion libs/font-color.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ function resetFontColorListner(fontColorbox) {

fontResetIcon.addEventListener("click", ()=>{
document.documentElement.style.setProperty('--font-color', BLACK);
removeLocalStorageItem(FONT_COLOR);
setFontColorbox(fontColorbox, BLACK);
setLocalStorageItem(FONT_COLOR, BLACK);
});
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/bani.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ onDomReady(initializeBaniApp);

// Functions which load immediatly after js starts

setBackgroundColorFromLocalGlobal();
setDarkModeCheckFromLocalGlobal();
setBackgroundColorFromLocalGlobal();
setFontColorFromLocalGlobal();
12 changes: 6 additions & 6 deletions styles/bani-styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
}

.shabad {
margin-bottom: 16px;
margin-bottom: 0.8rem;
}

.para {
margin-bottom: 30px;
margin-bottom: 1.5rem;
}

/*
Expand All @@ -42,15 +42,15 @@
}

.en {
margin-bottom: 8px;
margin-bottom: 0.5rem;
}

.d-inline {
display: inline !important;
}

.para-en, .para-pu {
margin-bottom: 12px;
margin-bottom: 0.5rem;
}

.para:first-child {
Expand All @@ -62,9 +62,9 @@
}

.gurmukhi {
margin-bottom: 5px;
margin-bottom: 0.5rem;
}

.para-gurmukhi {
margin-bottom: 8px;
margin-bottom: 0.5rem;
}
10 changes: 10 additions & 0 deletions styles/style.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
:root {
--dark-background-color: #121212;
--dark-font-color: #E0E0E0;
}

body {
margin: 0;
font-family: Arial, Helvetica, sans-serif;
Expand All @@ -9,6 +14,11 @@ body {
background-color: var(--background-color);
}

body.dark-mode {
color: var(--dark-font-color);
background-color: var(--dark-background-color);
}

.root {
/* overflow: hidden;
overflow-x: hidden; */
Expand Down

0 comments on commit 5dd6e17

Please sign in to comment.