From a419bad2424d3e963839527ac606020b608298ab Mon Sep 17 00:00:00 2001 From: Araozu Date: Sun, 10 Mar 2024 15:24:47 -0500 Subject: [PATCH] Move files around --- src/controller/mod.rs | 6 ++++++ src/main.rs | 48 ++----------------------------------------- src/view/mod.rs | 36 +++++++++++++++++++++++++++++--- tailwind.config.js | 35 ++++++++++++++++++++++++++++++- 4 files changed, 75 insertions(+), 50 deletions(-) create mode 100644 src/controller/mod.rs diff --git a/src/controller/mod.rs b/src/controller/mod.rs new file mode 100644 index 0000000..18947b9 --- /dev/null +++ b/src/controller/mod.rs @@ -0,0 +1,6 @@ +use maud::Markup; + +#[get("/")] +pub fn homepage() -> Markup { + crate::view::homepage() +} diff --git a/src/main.rs b/src/main.rs index 694e6e8..7d585d9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,59 +1,15 @@ #[macro_use] extern crate rocket; +mod controller; mod view; use maud::{html, Markup}; 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] fn rocket() -> _ { rocket::build() - .mount("/", routes![index]) + .mount("/", routes![controller::homepage]) .mount("/static", FileServer::from(relative!("static"))) } diff --git a/src/view/mod.rs b/src/view/mod.rs index eddb010..bc6e586 100644 --- a/src/view/mod.rs +++ b/src/view/mod.rs @@ -3,11 +3,11 @@ use maud::{html, Markup, DOCTYPE}; pub fn skeleton(body: Markup) -> Markup { html! { (DOCTYPE) - html lang="es" data-theme="dracula" { + html lang="es" data-theme="cupcake" { head { - title { "Sistema :D" } + title { "Jerguero" } 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) @@ -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!" } + }) +} diff --git a/tailwind.config.js b/tailwind.config.js index f847f6b..ebd6350 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -9,6 +9,39 @@ module.exports = { }, plugins: [require("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", + ] } }