Move files around

master
Araozu 2024-03-10 15:24:47 -05:00
parent 757e0a5f66
commit a419bad242
4 changed files with 75 additions and 50 deletions

6
src/controller/mod.rs Normal file
View File

@ -0,0 +1,6 @@
use maud::Markup;
#[get("/")]
pub fn homepage() -> Markup {
crate::view::homepage()
}

View File

@ -1,59 +1,15 @@
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
mod controller;
mod view; mod view;
use maud::{html, Markup}; use maud::{html, Markup};
use rocket::fs::{relative, FileServer}; use rocket::fs::{relative, FileServer};
#[get("/")]
fn index() -> Markup {
view::skeleton(html! {
h1 class="font-bold text-4xl text-center text-primary"
{
"Sistema EEGSAC"
}
br;
form action="/login" method="post" {
label class="form-control w-full max-w-xs"
{
div class="label"
{
span class="label-text"
{
"Usuario"
}
}
input type="text"
placeholder="Usuario"
required
class="input input-bordered input-primary w-full max-w-xs";
}
label class="form-control w-full max-w-xs"
{
div class="label"
{
span class="label-text"
{
"Contraseña"
}
}
input type="password"
placeholder="Contraseña"
required
class="input input-bordered input-primary w-full max-w-xs";
}
button class="btn btn-primary"
{
"Iniciar sesión"
}
}
})
}
#[launch] #[launch]
fn rocket() -> _ { fn rocket() -> _ {
rocket::build() rocket::build()
.mount("/", routes![index]) .mount("/", routes![controller::homepage])
.mount("/static", FileServer::from(relative!("static"))) .mount("/static", FileServer::from(relative!("static")))
} }

View File

@ -3,11 +3,11 @@ use maud::{html, Markup, DOCTYPE};
pub fn skeleton(body: Markup) -> Markup { pub fn skeleton(body: Markup) -> Markup {
html! { html! {
(DOCTYPE) (DOCTYPE)
html lang="es" data-theme="dracula" { html lang="es" data-theme="cupcake" {
head { head {
title { "Sistema :D" } title { "Jerguero" }
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" type="text/css" href="/static/styles.css"; link rel="stylesheet" type="text/css" href="/static/out.css";
} }
body { body {
(body) (body)
@ -15,3 +15,33 @@ pub fn skeleton(body: Markup) -> Markup {
} }
} }
} }
fn navbar() -> Markup {
html! {
nav class="navbar gap-1 fixed bottom-0 left-0 w-full border-t border-t-neutral" {
div class="flex-none" {
a class="btn btn-ghost text-xl" {
"J"
}
}
div class="flex-1" {
div class="form-control" {
input type="text" placeholder="Search" class="input input-bordered w-full md:w-auto";
}
}
div class="flex-none" {
a class="btn btn-ghost text-xl" {
"s"
}
}
}
}
}
pub fn homepage() -> Markup {
skeleton(html! {
(navbar())
h1 { "Jerguero" }
p { "¡Bienvenido a Jerguero!" }
})
}

View File

@ -9,6 +9,39 @@ module.exports = {
}, },
plugins: [require("daisyui")], plugins: [require("daisyui")],
daisyui: { daisyui: {
themes: ["retro", "coffee", "dracula"] themes: [
"light",
"dark",
"cupcake",
"bumblebee",
"emerald",
"corporate",
"synthwave",
"retro",
"cyberpunk",
"valentine",
"halloween",
"garden",
"forest",
"aqua",
"lofi",
"pastel",
"fantasy",
"wireframe",
"black",
"luxury",
"dracula",
"cmyk",
"autumn",
"business",
"acid",
"lemonade",
"night",
"coffee",
"winter",
"dim",
"nord",
"sunset",
]
} }
} }