From b6d9d117f6726a322a9c7dfc40eea15c97bece72 Mon Sep 17 00:00:00 2001 From: Erin Nova Date: Wed, 26 Jul 2023 00:13:06 -0400 Subject: [PATCH] Basic webpage and styling --- frontend/src/main.rs | 4 ++- static/home.html | 16 +++++++++-- static/style.css | 65 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 79 insertions(+), 6 deletions(-) diff --git a/frontend/src/main.rs b/frontend/src/main.rs index 58ee1f8..bf8ecfc 100644 --- a/frontend/src/main.rs +++ b/frontend/src/main.rs @@ -17,6 +17,7 @@ use url::Url; struct HomePage { title: String, description: String, + source: String, version: String, } @@ -55,7 +56,8 @@ async fn root() -> Html { let tpl = Template::new(contents).unwrap(); let rendered = tpl.render(&HomePage { title: "Ferret".to_string(), - description: "A small idependent search engine".to_string(), + description: "A small independent search engine".to_string(), + source: "https://git.lavender.software/erin/ferret".to_string(), version: "v0.2.0".to_string(), }); Html(rendered) diff --git a/static/home.html b/static/home.html index e77e2e0..3e4f8f6 100644 --- a/static/home.html +++ b/static/home.html @@ -14,7 +14,19 @@ {{title}} -

{{title}}

-
{{version}}
+
+

{{title}}

+ +
+ + +
+ + +
diff --git a/static/style.css b/static/style.css index de33a25..1740f8a 100644 --- a/static/style.css +++ b/static/style.css @@ -1,3 +1,62 @@ -body{margin:40px -auto;max-width:650px;line-height:1.6;font-size:18px;color:#444;padding:0 -10px}h1,h2,h3{line-height:1.2} +body{ + margin:40px auto; + max-width:650px; + line-height:1.6; + font-size:18px; + color:#444; + padding: 0 10px; + font-family: "Atkinson Hyperlegible"; +} +h1,h2,h3{line-height:1.2} + +h1 { + font-size: 3em; +} + +.container { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +footer { + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + padding-top: 25em; +} + +form { + flex-grow: 1; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 100%; + gap: .5em; +} + +input#search { + width: 100%; + font-size: 1.5em; +} + +.button { + font-size: 1.2em; +} + +footer p { + margin-bottom: 0; + font-style: italic; +} +footer a { + padding-top: 0px; + margin-top: 0; + margin-bottom: 0; +} +footer pre { + padding-top: 0px; + margin-top: 0; +}