Skip to content

Commit acab733

Browse files
committed
static: navbar improvements
1 parent c9dc049 commit acab733

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

internal/static/src/main.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ import "bootstrap/dist/css/bootstrap.min.css";
44
import "./style.css";
55
import { startApp } from "./app.js";
66

7-
document.querySelector(
8-
"#app"
9-
).innerHTML = `<nav id="navbar" class="navbar navbar-expand-lg bg-body-tertiary">
7+
document.querySelector("#app").innerHTML = `
8+
9+
10+
<nav id="navbar" class="navbar navbar-expand-lg bg-body-tertiary">
1011
<div class="container-fluid">
1112
<a class="navbar-brand">Statsviz</a>
1213
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
@@ -27,15 +28,15 @@ document.querySelector(
2728
<option value="600">10 minutes</option>
2829
</select>
2930
</li>
30-
<li class="nav-item d-flex align-items-center" style="margin-left: 25px;">
31+
<li class="nav-item d-flex align-items-center pt-3 pt-lg-1 ms-0 ms-lg-3">
3132
<div class="form-check form-switch">
32-
<input class="form-check-input" type="checkbox" id="dark_mode_switch" name="darkmode" value="yes">
33+
<input class="form-check-input" type="checkbox" id="dark_mode_switch" name="darkmode">
3334
<label class="form-check-label" for="darkmode">Dark Mode</label>
3435
</div>
3536
</li>
36-
<li class="nav-item d-flex align-items-center" style="margin-left: 25px;">
37+
<li class="nav-item d-flex align-items-center pt-3 pt-lg-1 ms-0 ms-lg-3">
3738
<div class="form-check form-switch">
38-
<input class="form-check-input" type="checkbox" id="show_gc_switch" name="showgc" value="yes">
39+
<input class="form-check-input" type="checkbox" id="show_gc_switch" name="showgc">
3940
<label class="form-check-label" for="showgc">Show GC</label>
4041
</div>
4142
</li>

internal/static/src/style.css

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@ body.dark-mode nav.navbar span.action svg {
2121
text-align: center;
2222
}
2323

24-
.container-xxl {
25-
width: 2190px;
26-
}
27-
2824
.tooltip-table {
2925
display: table;
3026
width: 160px;

internal/static/src/theme.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,12 @@ export const updateThemeMode = () => {
2525
if (themeMode === "dark") {
2626
document.body.classList.add("dark-mode");
2727
document.getElementById("navbar").setAttribute("data-bs-theme", "dark");
28+
document
29+
.getElementById("dark_mode_switch")
30+
.setAttribute("checked", "checked");
2831
} else {
2932
document.body.classList.remove("dark-mode");
3033
document.getElementById("navbar").setAttribute("data-bs-theme", "light");
34+
document.getElementById("dark_mode_switch").removeAttribute("checked");
3135
}
3236
};

0 commit comments

Comments
 (0)