Compare commits

...
1 Commits
Author SHA1 Message Date
Curid 827d33dd9c web: make sidebar collapsible in an annoying way
It resets to the expanded state every time you change page.
We've reached the limit of css-only sidebars.
2025-09-09 16:15:25 +00:00
4 changed files with 97 additions and 66 deletions
+65 -37
View File
@@ -575,18 +575,37 @@ img {
/* Mobile portrait mode */
/* sidebar */
/* Topbar */
#topbar {
z-index: 1;
width: 100%;
background: var(--color1);
height: var(--topbar-height);
padding-left: var(--topbar-height);
padding-right: var(--topbar-height);
}
#topbar-btn {
height: var(--topbar-height);
z-index: 2;
}
#options-btn {
right: 0;
z-index: 2;
width: var(--topbar-height);
height: var(--topbar-height);
}
#options-btn:hover ~ * #topbar-options-btn {
#topbar-options-btn {
visibility: hidden;
right: 0;
z-index: 1;
transition: 400ms;
}
#options-btn:hover ~ #topbar-options-btn {
background: var(--color2);
}
@@ -608,33 +627,6 @@ img {
display: flex !important;
}
/* Date picker. */
.date-picker-day-btn {
height: calc(var(--scale) * 2rem);
width: calc(var(--scale) * 2rem);
color: var(--color-text);
border-width: 2px;
border-color: var(--color2);
border-radius: var(--radius-lg);
background: var(--color3);
font-size: calc(var(--scale) * 1.5rem);
line-height: calc(var(--scale) * 1.9rem);
}
.date-picker-day-selected {
background: var(--color-red2);
}
.date-picker-hour {
display: flex;
justify-content: center;
}
.date-picker-hour-input::-webkit-inner-spin-button,
.date-picker-hour-input::-webkit-outer-spin-button {
-webkit-appearance: none;
}
/* Sidebar. */
#sidebar {
@@ -665,12 +657,35 @@ img {
width: var(--sidebar-width);
}
#sidebar-btn:hover ~ * #topbar-btn {
#sidebar-btn:hover ~ #topbar-btn {
background: var(--color2);
}
#sidebar-btn:hover ~ * #nav-btn {
background: var(--color2);
/* Date picker. */
.date-picker-day-btn {
height: calc(var(--scale) * 2rem);
width: calc(var(--scale) * 2rem);
color: var(--color-text);
border-width: 2px;
border-color: var(--color2);
border-radius: var(--radius-lg);
background: var(--color3);
font-size: calc(var(--scale) * 1.5rem);
line-height: calc(var(--scale) * 1.9rem);
}
.date-picker-day-selected {
background: var(--color-red2);
}
.date-picker-hour {
display: flex;
justify-content: center;
}
.date-picker-hour-input::-webkit-inner-spin-button,
.date-picker-hour-input::-webkit-outer-spin-button {
-webkit-appearance: none;
}
/* Content */
@@ -809,8 +824,9 @@ img {
#topbar {
flex-direction: column;
width: auto;
width: var(--topbar-height);
height: 100%;
padding: 0;
}
#options-btn {
@@ -820,6 +836,8 @@ img {
#topbar-options-btn {
margin-top: auto;
right: auto;
bottom: 0;
}
#options-menu {
@@ -869,8 +887,14 @@ img {
transition: width 400ms;
}
#topbar-btn {
z-index: 6;
}
#topbar-options-btn {
margin-left: auto;
right: auto;
left: calc(var(--sidebar-width) - var(--topbar-height));
z-index: 6;
}
#current-page {
@@ -922,7 +946,7 @@ img {
}
#sidebar-checkbox:checked ~ #sidebar {
width: 0 !important;
width: var(--topbar-height) !important;
}
#sidebar-checkbox:checked ~ #sidebar-btn {
@@ -930,12 +954,16 @@ img {
}
#sidebar-checkbox:checked ~ #content {
padding-left: 0;
padding-left: var(--topbar-height);
transition: padding-left 400ms;
}
#sidebar-checkbox:checked ~ #topbar {
width: calc(var(--topbar-height) * 2);
width: var(--topbar-height);
}
#sidebar-checkbox:checked ~ #topbar-options-btn {
left: var(--topbar-height);
opacity: 0.5;
}
+18 -29
View File
@@ -1,40 +1,29 @@
<input type="checkbox" id="sidebar-checkbox" class="absolute" style="display: none" />
<label
id="sidebar-btn"
for="sidebar-checkbox"
class="absolute"
style="z-index: 10; height: var(--topbar-height)"
></label>
<input
type="checkbox"
id="options-checkbox"
class="absolute"
style="visibility: hidden"
/>
<label
id="options-btn"
for="options-checkbox"
class="absolute"
style="width: var(--topbar-height); height: var(--topbar-height)"
></label>
<header id="topbar" class="absolute flex" style="background: var(--color1)">
<button id="topbar-btn" class="bg-color1">
<img
class="icon-filter p-2"
style="aspect-ratio: 1; width: var(--topbar-height)"
src="assets/icons/feather/menu.svg"
/>
</button>
<input type="checkbox" id="sidebar-checkbox" class="absolute" style="display: none" />
<button id="topbar-btn" class="absolute bg-color1">
<img
class="icon-filter p-2"
style="aspect-ratio: 1; width: var(--topbar-height)"
src="assets/icons/feather/menu.svg"
/>
</button>
<header id="topbar" class="absolute flex">
<h1 id="current-page" class="m-auto text-2 text-color">{{ current_page }}</h1>
<button id="topbar-options-btn" class="bg-color1" style="visibility: hidden">
<img
class="icon-filter p-3"
style="aspect-ratio: 1; width: var(--topbar-height)"
src="assets/icons/feather/sliders.svg"
/>
</button>
</header>
<label id="options-btn" for="options-checkbox" class="absolute"></label>
<input type="checkbox" id="options-checkbox" class="absolute" style="visibility: hidden"/>
<button id="topbar-options-btn" class="absolute bg-color1">
<img
class="icon-filter p-3"
style="aspect-ratio: 1; width: var(--topbar-height)"
src="assets/icons/feather/sliders.svg"
/>
</button>
<label
id="sidebar-closer"
for="sidebar-checkbox"
+7
View File
@@ -105,6 +105,13 @@
/* Tablet/Dektop. */
@media only screen and (min-width: 48rem) {
#topbar-options-btn {
display: none;
}
#sidebar-checkbox:checked ~ #topbar {
width: var(--topbar-height);
}
.log-list-wrapper {
position: static;
width: 100%;
+7
View File
@@ -123,6 +123,13 @@
/* Tablet/Dektop. */
@media only screen and (width >= 48rem) {
#topbar-options-btn {
display: none;
}
#sidebar-checkbox:checked ~ #topbar {
width: var(--topbar-height);
}
.settings-navbar {
width: auto;
padding-top: calc(var(--spacing) * 27);