diff --git a/src/public/mod.rs b/src/public/mod.rs index 3ddcc23..dbf6573 100644 --- a/src/public/mod.rs +++ b/src/public/mod.rs @@ -2,6 +2,8 @@ mod routes; mod templates; +use std::sync::Mutex; + use actix_web::{web, App, HttpServer}; use actix_files as actix_fs; @@ -13,7 +15,7 @@ pub(crate) async fn start_actix(config: &Config, database: Database) -> anyhow:: log::info!("Serving an http server at http://{bindip}"); HttpServer::new(move || { App::new() - .app_data(actix_web::web::Data::new(database.clone())) + .app_data(actix_web::web::Data::new(Mutex::new(database.clone()))) .route("/", web::get().to(routes::index)) // index.html .service(actix_fs::Files::new("/static", "./static").index_file("index.html")) // static directory .service(web::redirect("/favicon.ico", "/static/favicon.ico")) //? special redirect for favicon diff --git a/static/assets/placeholder.txt b/static/assets/placeholder.txt deleted file mode 100644 index 8b13789..0000000 --- a/static/assets/placeholder.txt +++ /dev/null @@ -1 +0,0 @@ - diff --git a/static/assets/uwu.jpg b/static/assets/uwu.jpg new file mode 100644 index 0000000..08bc09d Binary files /dev/null and b/static/assets/uwu.jpg differ diff --git a/static/css/global.css b/static/css/global.css index f4238b6..c7d9129 100644 --- a/static/css/global.css +++ b/static/css/global.css @@ -1,5 +1,5 @@ body { - + background: url(/static/assets/bg.gif); color: white; font-family: monospace; @@ -19,7 +19,7 @@ body { text-align: center; width: 100%; margin-top: 10px; - + } .titlebar { @@ -34,7 +34,7 @@ a:link { } #content { - width: 60%; + width: 50%; } #main-pane { @@ -71,7 +71,7 @@ a:link { width: 100%; } - + #content-pane, #sidenav { height: 100%; width: 100%; @@ -88,5 +88,5 @@ a:link { margin-left: 10px; } - + } diff --git a/static/css/index.css b/static/css/index.css index b28b04f..543a92f 100644 --- a/static/css/index.css +++ b/static/css/index.css @@ -1,3 +1,16 @@ +.post { + border: 2px solid purple; + height: 10%; + /* position: relative; + object-fit: contain; */ +} + +.post-img { + /* width: fit-content; + height: fit-content; + position: relative; + width: fit-content; */ +} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index 7095dc5..074aaed 100644 --- a/templates/index.html +++ b/templates/index.html @@ -6,6 +6,7 @@ placeholder + @@ -34,8 +35,14 @@
+

{{placeholder}}

+
+ post img +

Title text

+
Description text
+