aboutsummaryrefslogtreecommitdiff
path: root/css/navbar.css
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2024-04-12 13:24:23 +0200
committerlonkaars <loek@pipeframe.xyz>2024-04-12 13:24:23 +0200
commitce37824c5260dd370c61cf174ea80ca7deeb1058 (patch)
treec72f247e72c8279c93a662cdd46a440e825bdfbb /css/navbar.css
parentc364c4b0273e76cb13571878d1a4a2853a392b9b (diff)
more WIP transition
Diffstat (limited to 'css/navbar.css')
-rw-r--r--css/navbar.css143
1 files changed, 143 insertions, 0 deletions
diff --git a/css/navbar.css b/css/navbar.css
new file mode 100644
index 0000000..26d0b1d
--- /dev/null
+++ b/css/navbar.css
@@ -0,0 +1,143 @@
+.navbarItem .inner {
+ background-color: var(--bg-alt);
+ color: var(--fg);
+
+ padding: 8px;
+ border-radius: 8px;
+
+ transition-property: background-color, color;
+ transition-duration: .15s;
+
+ position: relative;
+}
+
+.navbarItem {
+ text-decoration: none;
+ display: block;
+}
+
+.navbarItem .icon { display: inline-block; }
+
+.navbarItem .icon .collapseIcon {
+ transform: rotate(0deg);
+ transition-property: transform;
+ transition-duration: .3s;
+}
+.navbarItem .icon .collapseIcon.collapsed {
+ transform: rotate(-90deg);
+}
+
+.navbarItem .icon,
+.navbarItem .title {
+ cursor: pointer;
+}
+
+.navbarItem.indentLevel0 { margin-bottom: 12px; }
+
+.navbarItem.active .inner,
+.navbarItem.link:hover .inner {
+ background-color: var(--fg-alt);
+ color: var(--bg-alt);
+}
+
+.navbarItem.chapter .inner,
+.navbarItem.pinned .inner {
+ background-color: transparent;
+ color: var(--fg);
+
+ padding: 4px 0;
+ overflow: visible;
+}
+
+.navbarItem.pinned .inner .title {
+ margin: 0;
+ font-style: italic;
+ opacity: .8;
+ color: var(--fg-alt)
+}
+.navbarItem.pinned * { cursor: default !important; }
+
+.navbarItem .title {
+ vertical-align: top;
+ margin-left: 8px;
+ margin-top: 3px;
+ display: inline-block;
+ text-overflow: ellipsis;
+ overflow: hidden;
+ white-space: nowrap;
+ width: calc(100% - 32px);
+}
+.navbarItem.chapter .title { margin-top: 1px; }
+
+.navbarItem.chapter .chapterChildren {
+ transition-property: height;
+ transition-duration: .3s;
+
+ overflow: hidden;
+}
+
+.navbarItem.chapter.childrenCollapsed > .chapterChildren { height: 0; }
+.navbarItem.chapter > .chapterChildren { height: var(--children-height); }
+
+.navbarItem .inner,
+.navbarItem .icon,
+.navbarItem .icon .collapseIcon {
+ height: 24px;
+}
+
+.navbarItem > div > svg { vertical-align: super; }
+
+@media (prefers-color-scheme: light) {
+ .navbarItem.active .inner,
+ .navbarItem.link:hover .inner {
+ background-color: var(--fg);
+ }
+
+ .navbarItem.pinned .inner .title {
+ opacity: .6;
+ color: var(--fg-alt);
+ }
+}
+
+.mobileNav {
+ width: 48px;
+ text-align: center;
+ line-height: 0;
+}
+
+.mobileNav .button:last-child {
+ margin-bottom: 0;
+}
+
+.mobileNav .button {
+ padding: 12px;
+ display: inline-block !important;
+ min-width: 0;
+ border-radius: 24px;
+ margin: 0;
+ box-shadow: 0 4px 10px -2px rgba(0, 0, 0, 25%);
+
+ width: 24px;
+ height: 24px;
+ position: relative;
+}
+
+.mobileNav .button > svg {
+ position: absolute;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -50%);
+ fill: currentColor !important;
+}
+
+.mobileNav .button.small {
+ padding: 6px;
+ margin-bottom: 12px;
+
+ opacity: 0;
+ transition: opacity .3s;
+}
+
+.mobileNav.open .button.small {
+ opacity: 1;
+}