i hate css

This commit is contained in:
Gvidas Juknevičius 2024-03-28 02:17:44 +02:00
parent 232e8e1a92
commit b45ab7aef5
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
6 changed files with 28 additions and 7 deletions

View File

@ -2,6 +2,8 @@
mod routes; mod routes;
mod templates; mod templates;
use std::sync::Mutex;
use actix_web::{web, App, HttpServer}; use actix_web::{web, App, HttpServer};
use actix_files as actix_fs; 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}"); log::info!("Serving an http server at http://{bindip}");
HttpServer::new(move || { HttpServer::new(move || {
App::new() 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 .route("/", web::get().to(routes::index)) // index.html
.service(actix_fs::Files::new("/static", "./static").index_file("index.html")) // static directory .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 .service(web::redirect("/favicon.ico", "/static/favicon.ico")) //? special redirect for favicon

View File

@ -1 +0,0 @@

BIN
static/assets/uwu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -1,5 +1,5 @@
body { body {
background: url(/static/assets/bg.gif); background: url(/static/assets/bg.gif);
color: white; color: white;
font-family: monospace; font-family: monospace;
@ -19,7 +19,7 @@ body {
text-align: center; text-align: center;
width: 100%; width: 100%;
margin-top: 10px; margin-top: 10px;
} }
.titlebar { .titlebar {
@ -34,7 +34,7 @@ a:link {
} }
#content { #content {
width: 60%; width: 50%;
} }
#main-pane { #main-pane {
@ -71,7 +71,7 @@ a:link {
width: 100%; width: 100%;
} }
#content-pane, #sidenav { #content-pane, #sidenav {
height: 100%; height: 100%;
width: 100%; width: 100%;
@ -88,5 +88,5 @@ a:link {
margin-left: 10px; margin-left: 10px;
} }
} }

View File

@ -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; */
}

View File

@ -6,6 +6,7 @@
<title>placeholder</title> <title>placeholder</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/static/css/global.css"> <link rel="stylesheet" href="/static/css/global.css">
<link rel="stylesheet" href="/static/css/index.css">
</head> </head>
@ -34,8 +35,14 @@
<div class="box" id="content-pane"> <div class="box" id="content-pane">
<p>{{placeholder}}</p> <p>{{placeholder}}</p>
<div class="post">
<img class="post-img" src="/static/assets/uwu.jpg" alt="post img">
<h3 class="post-title">Title text</h3>
<h5 class="post-desc">Description text</h5>
</div>
</div> </div>
</div> </div>