6 releases (3 breaking)

new 0.4.2 Nov 17, 2024
0.4.1 Nov 17, 2024
0.3.0 Nov 16, 2024
0.2.0 Nov 15, 2024
0.1.0 Nov 15, 2024

#1178 in Web programming

Download history 324/week @ 2024-11-13

324 downloads per month

MIT/Apache

26KB
381 lines

yew_confetti

Documentation crates.io Build Test Page

Confetti animation for Yew websites, inspired by canvas-confetti.

Usage

use yew::html;
use yew_confetti::{Confetti, Cannon, Mode};

// Defaults, except style prop.
// Shape and color props omitted.
html! {
    <Confetti
        width={256}
        height={256}
        decay={0.3}
        drift={0}
        gravity={1}
        lifespan={2.5}
        scalar={5}
        style={"background-color: black; width: 256px; height: 256px;"}
    >
        <Cannon
            x={0.5}
            y={0.5}
            angle={1.5707964}
            spread={0.7853982}
            velocity={2}
            mode={Mode::continuous(100)}
        />
    </Confetti>
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Dependencies

~11–20MB
~265K SLoC