✨ finalize ui
This commit is contained in:
parent
5ce50b76f5
commit
7ba30045a0
35 changed files with 4498 additions and 235 deletions
|
@ -1,6 +1,6 @@
|
|||
use based::get_pg;
|
||||
use based::request::{RequestContext, StringResponse};
|
||||
use based::ui::components::Shell;
|
||||
use based::ui::components::prelude::Shell;
|
||||
use based::ui::prelude::Nothing;
|
||||
use maud::html;
|
||||
use rocket::get;
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
use based::asset::AssetRoutes;
|
||||
use based::request::{RequestContext, StringResponse};
|
||||
use based::ui::components::{AppBar, Shell};
|
||||
use based::ui::htmx::{Event, HTMXAttributes};
|
||||
use based::ui::prelude::*;
|
||||
use maud::Render;
|
||||
use maud::html;
|
||||
use rocket::routes;
|
||||
use rocket::{State, get};
|
||||
|
||||
#[get("/")]
|
||||
pub async fn index_page(ctx: RequestContext, shell: &State<Shell>) -> StringResponse {
|
||||
let content = AppBar("MyApp", None).render();
|
||||
|
||||
let content = html!(
|
||||
h1 { "Hello World!" };
|
||||
|
||||
(
|
||||
Screen::medium(Hover(Background(Nothing()).color(Red::_700))).on(
|
||||
Background(Text("HELLO!")).color(Blue::_700)
|
||||
)
|
||||
)
|
||||
|
||||
(Hover(
|
||||
Cursor::NorthEastResize.on(
|
||||
Padding(Text("").color(&Gray::_400)).x(ScreenValue::_10)
|
||||
)
|
||||
).on(
|
||||
Link("/test", Text("Hello")).hx_get("/test").hx_get("/test").hx_trigger(
|
||||
Event::on_load().delay("2s")
|
||||
.and(Event::on_revealed())
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(content)
|
||||
|
||||
);
|
||||
|
||||
shell.render_page(content, "Hello World", ctx).await
|
||||
}
|
||||
|
||||
#[rocket::launch]
|
||||
async fn launch() -> _ {
|
||||
// Logging
|
||||
env_logger::init();
|
||||
|
||||
let shell = Shell::new(Nothing(), Nothing(), Nothing()).use_ui();
|
||||
|
||||
rocket::build()
|
||||
.mount("/", routes![index_page])
|
||||
.mount_assets() // Mount included assets routes
|
||||
.manage(shell) // Manage global shell reference
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue