Skip to content

Commit

Permalink
feat: move dark mode button
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Dec 8, 2024
1 parent 058e838 commit 382b8d7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
15 changes: 8 additions & 7 deletions dashboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,14 @@ <h4 class="m-0 p-0 flex-grow-1 text-end" id="dashboard-name">
<div class="rounded-4 p-2 mb-4 shadow" style="background-color: var(--bs-gray-200)">
<div class="d-flex justify-content-between">
<p class="fw-semibold m-1" style="color: var(--bs-gray-900);"><i class="fa-solid fa-home mx-2"></i>Home</p>
<button class="btn btn-success rounded-3 btn-sm m-0 pb-0" onclick="admin.download(this)" offline-disabled>
<i class="fa-solid fa-download"></i><span class="d-none d-sm-inline ms-2">Download</span>
</button>
<div class="d-flex">
<button class="btn btn-success rounded-3 btn-sm my-0 ms-0 me-2 pb-0" onclick="admin.download(this)" offline-disabled>
<i class="fa-solid fa-download"></i><span class="d-none d-sm-inline ms-2">Download</span>
</button>
<button class="btn btn-secondary rounded-3 btn-sm m-0 pb-0" onclick="theme.change()">
<i class="fa-solid fa-circle-half-stroke"></i><span class="d-none d-sm-inline ms-2">Theme</span>
</button>
</div>
</div>
</div>

Expand Down Expand Up @@ -294,10 +299,6 @@ <h6 class="fw-bold m-0 p-0" id="count-like">
<div class="p-3 bg-theme-light mb-3 rounded-4 shadow">
<p class="mx-0 mt-0 mb-1 p-0 fw-bold"><i class="fa-solid fa-sliders me-1"></i>Control</p>

<div class="form-check form-switch mb-1">
<input class="form-check-input" type="checkbox" role="button" id="darkMode" onchange="theme.change(this)">
<label class="form-check-label" for="darkMode">Dark Mode</label>
</div>
<div class="form-check form-switch mb-1">
<input class="form-check-input" type="checkbox" role="button" id="filterBadWord" onchange="admin.changeFilterBadWord(this)" offline-disabled>
<label class="form-check-label" for="filterBadWord">Filter Bad Word</label>
Expand Down
9 changes: 0 additions & 9 deletions js/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,15 +210,6 @@ export const theme = (() => {
} else {
onLight();
}

const toggle = document.getElementById('darkMode');
if (toggle) {
toggle.checked = isDarkMode();

if (!isAuto) {
toggle.parentElement.remove();
}
}
};

return {
Expand Down

0 comments on commit 382b8d7

Please sign in to comment.