add navbar + background + fading text

This commit is contained in:
2024-11-12 23:54:57 +01:00
parent 8ee1039de9
commit c87ecf0428
4 changed files with 185 additions and 15 deletions
+3 -5
View File
@@ -1,8 +1,8 @@
#[macro_use] extern crate rocket;
use rocket::form::Form;
use rocket::form::FromForm;
use rocket_dyn_templates::{Template, context};
use rocket::fs::FileServer;
#[derive(FromForm)]
struct LoginData {
@@ -16,10 +16,7 @@ fn login(login_data: Form<LoginData>) -> Template {
let correct_password = "password";
let message = if login_data.username == correct_username && login_data.password == correct_password {
// On successful login, you can perform actions here like creating directories.
println!("Login successful: performing server-side actions.");
"Login successful! Directories have been created."
"Login successful!"
} else {
"Invalid username or password."
};
@@ -36,6 +33,7 @@ fn index() -> Template {
fn rocket() -> _ {
rocket::build()
.mount("/", routes![index, login])
.mount("/static", FileServer::from("static")) // Serves files in the `static` directory
.attach(Template::fairing())
}