From 8d18c858b3f8814ba7a96a36a87a62b2271c996b Mon Sep 17 00:00:00 2001 From: jakubmanczak Date: Sun, 8 Mar 2026 12:08:53 +0100 Subject: [PATCH] mobile responsiveness --- src/web/components/nav.rs | 12 ++++++------ src/web/input.css | 2 ++ src/web/pages/dashboard.rs | 2 +- src/web/pages/login.rs | 16 +++++++++------- src/web/styles.css | 2 +- 5 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/web/components/nav.rs b/src/web/components/nav.rs index f2d9fa8..856722a 100644 --- a/src/web/components/nav.rs +++ b/src/web/components/nav.rs @@ -15,17 +15,17 @@ const LINKS: &[(&str, &str, &str)] = &[ pub fn nav(user: Option, uri: &str) -> Markup { html!( div class="flex items-center text-sm gap-4 border-b border-neutral-200/25 bg-neutral-200/5 px-4 py-2" { - a href="/dashboard" class="font-lora font-semibold text-xl mr-2" {"Mnemosyne"} - div class="w-px h-5 bg-neutral-200/15" {} + a href="/dashboard" class="font-lora font-semibold hidden xs:block md:text-xl sm:mr-2" {"Mnemosyne"} + div class="w-px h-5 bg-neutral-200/15 hidden sm:block" {} div class="flex flex-row" { @for link in LINKS { a href={(link.1)} class="flex flex-row px-2 py-1 rounded items-center gap-2 hover:bg-neutral-200/5 border border-transparent hover:border-neutral-200/25" { @if uri.starts_with(link.1) { div class="scale-[.75] text-neutral-300" {(PreEscaped(link.2))} - span class="text-neutral-200 font-light" { (link.0) } + span class="text-neutral-200 font-light hidden lg:block" { (link.0) } } @else { div class="scale-[.75] text-neutral-500" {(PreEscaped(link.2))} - span class="text-neutral-400 font-light" { (link.0) } + span class="text-neutral-400 font-light hidden lg:block" { (link.0) } } } } @@ -35,13 +35,13 @@ pub fn nav(user: Option, uri: &str) -> Markup { @if let Some(u) = user { a href="/dashboard" class=r#"ml-auto bg-neutral-200/5 font-lexend flex flex-row items-center border border-neutral-200/25 gap-4 rounded px-2 py-1"# { - (u.handle) + span class="hidden sm:block"{(u.handle)} div class="scale-[.75]" {(PreEscaped(icons::USER))} } } @else { a href="/login" class=r#"ml-auto bg-neutral-200/5 font-lexend flex flex-row items-center border border-neutral-200/25 gap-4 rounded px-2 py-1"# { - "Log in" + span class="hidden sm:block"{"Log in"} div class="scale-[.75]" {(PreEscaped(icons::USER_KEY))} } } diff --git a/src/web/input.css b/src/web/input.css index 1044cd7..39784d9 100644 --- a/src/web/input.css +++ b/src/web/input.css @@ -7,6 +7,8 @@ --font-lora: "Lora", ui-serif, Georgia, Cambria, "Times New Roman", serif; --font-lexend: "Lexend", sans-serif; + --breakpoint-xs: 30rem; + --animate-marquee: marquee 180s linear infinite; } diff --git a/src/web/pages/dashboard.rs b/src/web/pages/dashboard.rs index 1c1dcd9..9c2f580 100644 --- a/src/web/pages/dashboard.rs +++ b/src/web/pages/dashboard.rs @@ -13,7 +13,7 @@ pub async fn page(req: Request) -> Markup { html!( (nav(u, req.uri().path())) - div class="text-8xl text-neutral-800/25 mt-16 text-center font-semibold font-lora select-none" {"Mnemosyne"} + div class="text-6xl sm:text-8xl text-neutral-800/25 mt-16 text-center font-semibold font-lora select-none overflow-hidden" {"Mnemosyne"} ), ) } diff --git a/src/web/pages/login.rs b/src/web/pages/login.rs index ffeef98..d27e7c2 100644 --- a/src/web/pages/login.rs +++ b/src/web/pages/login.rs @@ -28,15 +28,17 @@ pub async fn page(Query(q): Query, req: Request) -> Result, req: Request) -> Result