feat(demo): update Home

This commit is contained in:
luoxiao 2024-08-26 00:14:02 +08:00
parent f408899eda
commit 7893d35239

View file

@ -1,3 +1,4 @@
use crate::components::SiteHeader;
use leptos::prelude::*; use leptos::prelude::*;
use leptos_router::hooks::{use_navigate, use_query_map}; use leptos_router::hooks::{use_navigate, use_query_map};
use thaw::*; use thaw::*;
@ -12,31 +13,41 @@ pub fn Home() -> impl IntoView {
navigate(&path, Default::default()); navigate(&path, Default::default());
} }
view! { view! {
<Layout <Layout position=LayoutPosition::Absolute>
position=LayoutPosition::Absolute <SiteHeader/>
content_style="display: flex; align-items: center; justify-content: center; flex-direction: column;" <Layout
> position=LayoutPosition::Absolute
<h1 style="font-size: 80px; line-height: 1;margin: 0 0 18px;">"Thaw UI"</h1> attr:style="top: 64px"
<p>"An easy to use leptos component library"</p> >
<Space> <div style="width: 1100px; margin: calc(50vh - 200px) auto 0; display: flex">
<Button <div style="width: 50%">
appearance=ButtonAppearance::Primary <h2 style="line-height: 64px; font-size: 56px; margin: 0 0 18px">"Thaw UI"</h2>
on_click=move |_| { <p style="line-height: 36px; font-size: 24px">"An easy to use leptos component library"</p>
navigate("/components/button", Default::default()); <Space>
} <Button
> appearance=ButtonAppearance::Primary
"Read the docs" on_click=move |_| {
</Button> navigate("/components/button", Default::default());
<Button }
appearance=ButtonAppearance::Subtle >
on_click=move |_| { "Read the docs"
_ = window().open_with_url("http://github.com/thaw-ui/thaw"); </Button>
} <Button
> appearance=ButtonAppearance::Subtle
on_click=move |_| {
_ = window().open_with_url("http://github.com/thaw-ui/thaw");
}
>
"Github" "Github"
</Button> </Button>
</Space> </Space>
</div>
<div style="width: 50%; text-align: center">
<img src="/logo.svg" style="width: 200px"/>
</div>
</div>
</Layout>
</Layout> </Layout>
} }
} }