-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
56 changed files
with
1,086 additions
and
3,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
use lerni::{properties::Color, widgets::*}; | ||
use wasm_bindgen::prelude::wasm_bindgen; | ||
use yew::prelude::*; | ||
use leptos::*; | ||
use lerni::*; | ||
|
||
#[function_component] | ||
pub fn Blur() -> Html { | ||
let blur = use_state(|| false); | ||
let onclick = { | ||
let blur = blur.clone(); | ||
Callback::from(move |_| blur.set(!*blur)) | ||
}; | ||
#[component] | ||
pub fn Blur() -> impl IntoView { | ||
let (blur, set_blur) = create_signal(false); | ||
let on_click = move |_| set_blur.set(!blur.get()); | ||
|
||
html! { | ||
<Slide blur={ *blur } background_color={ Color::MistyRose }> | ||
<Button text="Blur ON/OFF" { onclick } /> | ||
view! { | ||
<Slide blur=blur.into() background_color=Color::MistyRose> | ||
<Button on_click=on_click> | ||
"Blur " {move || if blur.get() { "ON" } else { "OFF" }} | ||
</Button> | ||
</Slide> | ||
} | ||
} | ||
|
||
#[wasm_bindgen(start)] | ||
pub fn main() { | ||
lerni::start::<Blur>(); | ||
lerni::start(Blur); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
use lerni::{properties::*, widgets::*}; | ||
use wasm_bindgen::prelude::wasm_bindgen; | ||
use yew::prelude::*; | ||
use leptos::*; | ||
use lerni::*; | ||
|
||
#[function_component] | ||
pub fn Buttons() -> Html { | ||
let counter = use_state(|| 0); | ||
let onclick = { | ||
let counter = counter.clone(); | ||
Callback::from(move |_| counter.set(*counter + 1)) | ||
#[component] | ||
pub fn Buttons() -> impl IntoView { | ||
let (counter, set_counter) = create_signal(0); | ||
let on_click = move |_| { | ||
logging::log!("Clicked"); | ||
set_counter.set(counter.get() + 1); | ||
}; | ||
|
||
html! { | ||
view! { | ||
<Slide> | ||
<Grid cols=3 rows=3> | ||
<Button text="Alice" onclick={ onclick.clone() } /> | ||
<Button text="Bob" width=300 height=300 radius=150 onclick={ onclick.clone() } /> | ||
<Button text="Charlie" font_size=72 text_color={ Color::DarkCyan } onclick={ onclick.clone() } /> | ||
<Button html={ html!(<><tspan font-size="96" fill="red">{ "Da" }</tspan><tspan font-size="80">{ "ve" }</tspan></>) } | ||
onclick={ onclick.clone() } /> | ||
<Label text={ format!("Clicked: {}", *counter) }/> | ||
<Button text="Eve" text_bold=true align={ Align::Right } onclick={ onclick.clone() } /> | ||
<Button text="Ferdie" align={ Align::Right } valign={ VAlign::Bottom } onclick={ onclick.clone() } /> | ||
<Button text="George" color={ Color::Honeydew } border_color={ Color::ForestGreen } onclick={ onclick.clone() } /> | ||
<Button text="Harry" align={ Align::Fill } valign={ VAlign::Fill } { onclick } /> | ||
<Button on_click=on_click>"Alice"</Button> | ||
<Button width=300 height=300 radius=150 on_click=on_click>"Bob"</Button> | ||
<Button font_size=72 text_color=Color::DarkCyan on_click=on_click>"Charlie"</Button> | ||
<Button on_click=on_click> | ||
<tspan font-size="96" fill="red" alignment-baseline="central">"Da"</tspan> | ||
<tspan font-size="80" alignment-baseline="central">"ve"</tspan> | ||
</Button> | ||
<Label>{counter}</Label> | ||
<Button text_bold=true align=Align::Right on_click=on_click>"Eve"</Button> | ||
<Button align=Align::Right valign=VAlign::Bottom on_click=on_click>"Ferdie"</Button> | ||
<Button color=Color::Honeydew border_color=Color::ForestGreen on_click=on_click>"George"</Button> | ||
<Button align=Align::Fill valign=VAlign::Fill on_click=on_click>"Harry"</Button> | ||
</Grid> | ||
</Slide> | ||
} | ||
} | ||
|
||
#[wasm_bindgen(start)] | ||
pub fn main() { | ||
lerni::start::<Buttons>(); | ||
lerni::start(Buttons); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.