From 663cea79ad24b54c0432208f29b9a0f0db93872e Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 17 Apr 2024 04:33:34 +0200 Subject: [PATCH] feat(web): sticky navbar and post box because of this the whole page now scrolls properly and remembers your scroll position if you use back/forward! --- web/index.html | 22 ++++++++++++++++++++-- web/src/main.rs | 18 ++++++++---------- 2 files changed, 28 insertions(+), 12 deletions(-) diff --git a/web/index.html b/web/index.html index 92cd86fc..eb1fbf9d 100644 --- a/web/index.html +++ b/web/index.html @@ -17,6 +17,26 @@ :root { --main-col-percentage: 70%; } + body { + margin: 0; + } + nav { + top: 0; + position: sticky; + background-color: var(--background); + padding-top: .05em; + } + hr.nav { + margin-top: 0; + padding-top: 0; + border: 1px solid #bf616a70; + top: 1.65rem; + position: sticky; + } + div.sticky { + top: 4em; + position: sticky; + } .hidden { display: none; } a.upub-title { color: var(--primary); @@ -34,8 +54,6 @@ border-radius: 50%; } div.boxscroll { - max-height: calc(100vh - 7rem); - overflow-y: scroll; } div.tl-header { background-color: #bf616a55; diff --git a/web/src/main.rs b/web/src/main.rs index 644a8ea6..4c6ad0da 100644 --- a/web/src/main.rs +++ b/web/src/main.rs @@ -33,16 +33,14 @@ fn main() { mount_to_body( move || view! { -