From 0957cc703c8ff1be90bbc96ff2c9f362d0b137c2 Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Sat, 1 Feb 2025 00:39:16 -0800 Subject: [PATCH] template stuff --- src/main.rs | 2 ++ static/css/style.css | 65 +++++++++++++++++++++++++++++++++++++++ templates/index.html.tera | 20 +----------- 3 files changed, 68 insertions(+), 19 deletions(-) create mode 100644 static/css/style.css diff --git a/src/main.rs b/src/main.rs index 33bafd9..610d31b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,6 +2,7 @@ use rocket::serde::{Serialize, json::Json}; use rocket_dyn_templates::{Template, context}; +use rocket::fs::FileServer; #[derive(Serialize)] #[serde(crate = "rocket::serde")] @@ -27,5 +28,6 @@ fn index() -> Template { fn rocket() -> _ { rocket::build() .mount("/", routes![index, message]) + .mount("/static", FileServer::from("static")) .attach(Template::fairing()) } diff --git a/static/css/style.css b/static/css/style.css new file mode 100644 index 0000000..9178b01 --- /dev/null +++ b/static/css/style.css @@ -0,0 +1,65 @@ +:root { + --primary-red: #f43f3f; + --dark-bg: #1e1f26; + --sidebar-bg: #2b2c33; + --text-color: #ffffff; + --text-muted: #9da2b3; +} + +body { + margin: 0; + padding: 0; + font-family: Arial, sans-serif; + display: flex; + background-color: var(--dark-bg); + color: var(--text-color); +} + +.sidebar { + width: 250px; + background-color: var(--sidebar-bg); + min-height: 100vh; + padding: 20px; + box-shadow: 2px 0 5px rgba(0,0,0,0.3); +} + +.sidebar h2 { + color: var(--primary-red); + margin-top: 0; +} + +.sidebar ul { + list-style: none; + padding: 0; +} + +.sidebar ul li { + margin: 10px 0; +} + +.sidebar ul li a { + color: var(--text-muted); + text-decoration: none; + transition: color 0.2s ease; +} + +.sidebar ul li a:hover { + color: var(--primary-red); +} + +.main-content { + flex: 1; + padding: 20px 40px; +} + +.main-content h1 { + color: var(--primary-red); + font-size: 2.5em; + margin-bottom: 0.5em; +} + +.main-content p { + line-height: 1.6; + color: var(--text-muted); + margin-bottom: 1.5em; +} \ No newline at end of file diff --git a/templates/index.html.tera b/templates/index.html.tera index 092d665..5eeabd1 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -4,25 +4,7 @@ RSS Reader - +