web search done right
better responsiveness mobile
Mikkel Denker816b9660f133
diff --git a/frontend/src/components/Header.astro b/frontend/src/components/Header.astroindex bd5dbe20..2fc59fa0 100644--- a/frontend/src/components/Header.astro+++ b/frontend/src/components/Header.astro@@ -17,7 +17,7 @@ const { icon = true, searchbar } = Astro.props;icon && (<div class="col-start-1 mr-4 sm:mr-0 h-12"><a href="/">- <img src="/images/logo_beta.svg" class="h-full w-full" />+ <img src="/images/logo_beta.svg" class="h-full" /></a></div>)diff --git a/frontend/src/components/Searchbar.astro b/frontend/src/components/Searchbar.astroindex 51f9ca00..f57606ce 100644--- a/frontend/src/components/Searchbar.astro+++ b/frontend/src/components/Searchbar.astro@@ -53,7 +53,7 @@ const { autofocus, query } = Astro.props;<div class="flex items-center justify-center p-[2px]"><buttontype="submit"- class="rounded-full h-full px-5 bg-brand opacity-75 text-white hover:opacity-100 transition-colors duration-50"+ class="rounded-full h-full px-2 md:px-5 bg-brand opacity-75 text-sm text-white hover:opacity-100 transition-colors duration-50"style="border: none"title="Search">diff --git a/frontend/src/components/Sidebar.astro b/frontend/src/components/Sidebar.astroindex 3da2cae1..548c9416 100644--- a/frontend/src/components/Sidebar.astro+++ b/frontend/src/components/Sidebar.astro@@ -8,13 +8,11 @@ export interface Props {}----<div>- {- askama.match("sidebar", {- "Sidebar::Entity(entity)": <Entity entity="entity" />,- "Sidebar::StackOverflow{title, answer}": (- <StackOverflow title="title" answer="answer" />- ),- })- }-</div>+{+ askama.match("sidebar", {+ "Sidebar::Entity(entity)": <Entity entity="entity" />,+ "Sidebar::StackOverflow{title, answer}": (+ <StackOverflow title="title" answer="answer" />+ ),+ })+}diff --git a/frontend/src/components/StackOverflow.astro b/frontend/src/components/StackOverflow.astroindex d601719d..97127e61 100644--- a/frontend/src/components/StackOverflow.astro+++ b/frontend/src/components/StackOverflow.astro@@ -8,7 +8,7 @@ export interface Props {}----<div class="flex max-w-lg flex-col space-y-5 rounded-lg border p-5 overflow-hidden">+<div class="flex md:max-w-lg flex-col space-y-5 rounded-lg border p-5 overflow-hidden"><div class="flex flex-col space-y-1"><div class="flex grow justify-between space-x-2"><div>@@ -34,11 +34,11 @@ export interface Props {<div class="flex flex-col space-y-3">{askama.for_("part in answer.body", () => (- <div>+ <div class="overflow-scroll">{askama.match("part", {"CodeOrText::Text(text)": <span>{askama`text`}</span>,"CodeOrText::Code(code)": (- <pre class="rounded-lg bg-slate-50 overflow-scroll"><code style="background: none">{askama`code`}</code></pre>+ <pre class="rounded-lg bg-slate-50"><code style="background: none">{askama`code`}</code></pre>),})}</div>diff --git a/frontend/src/pages/search.astro b/frontend/src/pages/search.astroindex fb7a86ff..6fe78f33 100644--- a/frontend/src/pages/search.astro+++ b/frontend/src/pages/search.astro@@ -19,11 +19,11 @@ import { askama } from "../askama";<div class="w-full h-[1px] bg-gradient-to-r from-cyan-400 via-brand to-cyan-400"></div><div- class="search-content mx-1 grid gap-y-6 pt-4 px-5 md:grid-cols-[minmax(50ch,48rem)_1fr] md:grid-rows-[auto_1fr] md:gap-x-12 md:pl-20 lg:mx-0 lg:px-36"+ class="search-content flex w-screen m-0 grid gap-y-6 pt-4 px-5 md:grid-cols-[minmax(50ch,48rem)_1fr] md:grid-rows-[auto_1fr] md:gap-x-12 md:pl-20 lg:px-36"><!-- Stats and settings --><div class="mx-auto flex w-full justify-between">- <div class="flex h-full flex-col justify-center text-sm text-gray-600">+ <div class="flex space-x-2 h-full flex-col justify-center text-sm text-gray-600"><p class="h-fit">Found {askama`num_matches $ 24`} results in {askama`search_duration_sec $ 0.42s`@@ -158,7 +158,7 @@ import { askama } from "../askama";{askama.if_("let Some(sidebar) = sidebar",- <div class="row-start-2 flex justify-center md:pt-10 md:col-start-2 md:row-span-2 md:row-start-1">+ <div class="row-start-2 justify-center md:pt-10 md:col-start-2 md:row-span-2 md:row-start-1" style="max-width: 90vw; margin-left: auto; margin-right: auto;"><Sidebar sidebar="sidebar" /></div>)@@ -230,6 +230,7 @@ import { askama } from "../askama";</script>})}+<script is:inline>var rankingAdjustButtons = document.querySelectorAll(".adjust-btn");var titleLinks = document.querySelectorAll(".sr-title-link");