tawasuyu/llimphi
Sovereign retained-mode GPU UI framework in Rust (wgpu+vello+taffy+parley), Elm loop, 40+ widgets.
chore: refresco desde el monorepo — vello 0.9 / wgpu 29, 120 miembros
1//! Demo del sello wawa. Tres tamaños sobre fondo oscuro neutro.
2//!
3//! `cargo run -p llimphi-widget-wawa-mark --example wawa_mark_demo --release`
4
5use llimphi_ui::llimphi_layout::taffy::{
6 prelude::{length, percent, FlexDirection, Size, Style},
7 AlignItems, JustifyContent, Rect,
8};
9use llimphi_ui::llimphi_raster::peniko::Color;
10use llimphi_ui::{App, Handle, View};
11use llimphi_widget_wawa_mark::{wawa_mark_view, WawaMarkPalette};
12
13struct Demo;
14
15impl App for Demo {
16 type Model = ();
17 type Msg = ();
18
19 fn title() -> &'static str {
20 "wawa · sello"
21 }
22
23 fn initial_size() -> (u32, u32) {
24 (820, 420)
25 }
26
27 fn init(_: &Handle<Self::Msg>) {}
28 fn update(model: Self::Model, _: Self::Msg, _: &Handle<Self::Msg>) -> Self::Model {
29 model
30 }
31
32 fn view(_: &Self::Model) -> View<Self::Msg> {
33 let palette = WawaMarkPalette::default();
34
35 let frame = |side: f32| -> View<()> {
36 View::new(Style {
37 size: Size {
38 width: length(side),
39 height: length(side),
40 },
41 align_items: Some(AlignItems::CENTER),
42 justify_content: Some(JustifyContent::CENTER),
43 ..Default::default()
44 })
45 .children(vec![wawa_mark_view(&palette)])
46 };
47
48 let row = View::new(Style {
49 flex_direction: FlexDirection::Row,
50 size: Size {
51 width: percent(1.0_f32),
52 height: percent(1.0_f32),
53 },
54 align_items: Some(AlignItems::CENTER),
55 justify_content: Some(JustifyContent::SPACE_EVENLY),
56 gap: Size {
57 width: length(24.0_f32),
58 height: length(0.0_f32),
59 },
60 ..Default::default()
61 })
62 .children(vec![frame(72.0), frame(160.0), frame(288.0)]);
63
64 View::new(Style {
65 size: Size {
66 width: percent(1.0_f32),
67 height: percent(1.0_f32),
68 },
69 padding: Rect {
70 left: length(32.0_f32),
71 right: length(32.0_f32),
72 top: length(32.0_f32),
73 bottom: length(32.0_f32),
74 },
75 ..Default::default()
76 })
77 // Fondo grafito neutro para que el rombo destaque sin competir.
78 .fill(Color::from_rgba8(18, 18, 22, 255))
79 .children(vec![row])
80 }
81}
82
83fn main() {
84 llimphi_ui::run::<Demo>();
85}