From 93931685b691026e9b47b685829ad884445df2b3 Mon Sep 17 00:00:00 2001 From: zoe Date: Thu, 20 Jan 2022 17:35:50 +0100 Subject: [PATCH] final touches before it's done --- src/main.rs | 6 ++-- static/index.html | 35 ++++++++++++++++++++ static/style.css | 70 ++++++++++++++++++++++++++++++--------- static/think.svg | 1 + style.css | 28 ---------------- templates/wisdom.html.hbs | 3 +- wisdom.service | 2 +- 7 files changed, 96 insertions(+), 49 deletions(-) create mode 100644 static/index.html create mode 100644 static/think.svg delete mode 100644 style.css diff --git a/src/main.rs b/src/main.rs index 4b4f119..1239331 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ #[macro_use] extern crate rocket; use rocket_dyn_templates::Template; -use rocket::fs::{FileServer, relative}; +use rocket::fs::{FileServer, relative, NamedFile}; #[macro_use] extern crate lazy_static; use clap::Parser; @@ -19,8 +19,8 @@ lazy_static! { } #[get("/")] -fn index() -> String { - "Hello".to_string() +async fn index() -> Option { + NamedFile::open("static/index.html").await.ok() } #[get("/cooking")] diff --git a/static/index.html b/static/index.html new file mode 100644 index 0000000..c9b9b9e --- /dev/null +++ b/static/index.html @@ -0,0 +1,35 @@ + + + + + + Wisdom + + + + +
+

+

Welcome to wisdom!


+

+
+
+

+

What is this?

+ This quite possibly might be the wisest website ever created.
+ Apart from that it's a website that gives you responses created via markov chain. +

Who did this (crying laughing emoji)

+ Me!!! I'm Zoe (they/fae/she), hello! +

Types of wisdom

+ This website can currently generate two types of wisdom. One markov chain uses questions from Jonathan Frakes Asks you Things. The other one uses input from recipes, comments, etc. found on a recipe website. +

Can i see the source code?

+ Quite possibly! It should be on github. +

+
+ + + diff --git a/static/style.css b/static/style.css index dbf45a3..cd2b655 100644 --- a/static/style.css +++ b/static/style.css @@ -1,11 +1,15 @@ -@import url("https://fonts.googleapis.com/css2?family=Prata&display=swap"); -html, body { +@import url('https://fonts.googleapis.com/css2?family=Amiri&display=swap'); +html, +body { margin: 0; + text-align: center; padding: 0; size: 100%; height: 100%; + color: floralwhite; } -div { + +#main { margin: 0; padding: 0; display: flex; @@ -15,15 +19,25 @@ div { margin-left: 8%; margin-right: 8%; } -.wisdom { - display: flex; - font-size: 3.6em; - text-align: center; + +div { + margin-left: 5%; + margin-right: 5%; } -a {font-family: "Prata", serif; -color: floralwhite; -text-decoration: none; +.wisdom { + font-family: "Amiri", serif; + display: flex; + font-size: 4.2em; + text-align: center; + text-decoration: none; +} + +a, +p { + color: floralwhite; + text-align: center; + text-decoration: none; } a:hover { @@ -34,22 +48,46 @@ body { } footer * { overflow: visible; + color: #080808; margin-left: 5%; margin-right: 5%; + text-decoration: none; } footer { - border-top-style: solid; - border-top-width: 2%; - border-color: floralwhite; - background-color: #080808; + font-family: 'Amiri', serif; + background-color: floralwhite; position: sticky; overflow: visible; left: 0; display: flex; - height: 8%; + height: 10%; bottom: 0; width: 100%; - font-size: 1.5em; + font-size: 1.6em; justify-content: center; align-items: center; } + +footer p { + width: 100%; + margin: 0; + padding: 0; +} + +h1.wisdom { + font-size: 6.4em; +} + + #about a{ + background-color: floralwhite; + color: #080808; +} + +#about { + font-family: 'Amiri', serif; + font-size: 1.6em; +} + +#about h2 { + font-size: 2.4em; +} diff --git a/static/think.svg b/static/think.svg new file mode 100644 index 0000000..d0587c9 --- /dev/null +++ b/static/think.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/style.css b/style.css deleted file mode 100644 index 8abec64..0000000 --- a/style.css +++ /dev/null @@ -1,28 +0,0 @@ -@import url("https://fonts.googleapis.com/css2?family=Prata&display=swap"); -body { - margin: 0; - padding: 0; -} -div { - margin: 0; - padding: 0; - display: flex; - justify-content: center; - align-items: center; - height: 100%; - margin-left: 24%; - margin-right: 24%; -} -a { - color: floralwhite; - font-size: 400%; - text-align: center; - font-family: "Prata", serif; - text-decoration: none; -} -a:hover { - text-decoration: underline; -} -body { - background-color: #080808; -} diff --git a/templates/wisdom.html.hbs b/templates/wisdom.html.hbs index 60ea3ab..11c10fd 100644 --- a/templates/wisdom.html.hbs +++ b/templates/wisdom.html.hbs @@ -5,6 +5,7 @@ Wisdom +
@@ -14,7 +15,7 @@
diff --git a/wisdom.service b/wisdom.service index b6d07be..b56b836 100644 --- a/wisdom.service +++ b/wisdom.service @@ -8,7 +8,7 @@ Group=wisdom Type=exec Restart=on-failure -ExecStart=/media/data/wisdom --input input +ExecStart=/media/data/wisdom WorkingDirectory=/media/data/wisdom [Install]