Security News
Supply Chain Attack Detected in @solana/web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
svelte-confetti-p5
Advanced tools
An awesome svelte realistic fullpage confetti animation, that can be customized in creative ways like snow flakes, falling balls and more.
svelte-confetti-p5
is an awesome svelte realistic fullpage confetti animation, that can be customized in creative ways like snow flakes, falling balls and more.
No CSS animations, but html Canvas created using P5.js (library for creative coding)
# pnpm
pnpm i -D svelte-confetti-p5
pnpm is used here just as an example, you can use your package of choice
<script>
import { ConfettiP5 } from "svelte-confetti-p5";
</script>
<ConfettiP5 />
Prop | Type | Description | Default |
---|---|---|---|
amount | number | Amount of particles | 300 |
colors | string[] | Colors of the confetti. Default is very colorful | ["#f44336", "#e91e63", "#9c27b0", "#673ab7", "#3f51b5", "#2196f3", "#03a9f4", "#00bcd4", "#009688", "#4CAF50", "#8BC34A", "#CDDC39", "#FFEB3B", "#FFC107", "#FF9800", "#FF5722"] |
minSize | number | Minimum particle size in pixels | 5 |
maxSize | number | Minimum particle size in pixels | 15 |
loop | boolean | Rain forever or until all particles fall | false |
spacing | number | Spacing between particles | 10 |
power | number | The force of the confetti when it starts | 10 |
shapes | "squares" | "circles" | "mix" | Particle shapes | "mix" |
wind | number | Wind from sides | 6 |
weight | number | Weight of the particle (this determines the falling speed) | 100 |
rotate | number | Rotate particles from side to side because of wind | 2 |
flip | number | Flip amount to create 3d effect for each particle | 20 |
position | "fixed" | "absolute" | Css position of the canvas | "fixed" |
zIndex | number | z-index of the canvas | 999 |
destoryOnFinish | boolean | If loop === false , destroys the canvas when all particles fall | true |
frameRate | number | Refresh rate. Changing this will affect the overall speed of the animation. Recommended to keep as default | 60 |
Dispatcher | Description | event returns |
---|---|---|
on:start | Fires when the confetti animation starts | - |
on:eachfall | Fires when a single confetti particle has falled | on:eachfall=(e => e.detail) returns the total amount of particles falled |
on:done | Fires when all confetti particles fall | - |
on:destroy | Fires when the canvas is destroyed, automaticlly happens when all particles finished falling | - |
<ConfettiP5
on:eachfall={onEachFall}
on:start={onStart}
on:done={onDone}
on:destory={onDestroy}
loop
colors={["#fbfefd", "#00186a", "#003afb", "#7aa8f7"]}
amount={120}
minSize={5}
maxSize={15}
spacing={15}
flip={3}
wind={0}
weight={100}
rotate={3}
power={0}
/>
<ConfettiP5
on:eachfall={onEachFall}
on:start={onStart}
on:done={onDone}
on:destory={onDestroy}
colors={["#e7edf3", "#e4f3ff", "#b9e1ff", "#a6d9ff"]}
shapes="circles"
minSize={0}
maxSize={14}
spacing={5}
amount={50}
flip={0}
wind={0}
power={2}
weight={50}
/>
More examples here
Playground here
(Dev note): To publish this library to npm:
pnpm publish
FAQs
An awesome svelte realistic fullpage confetti animation, that can be customized in creative ways like snow flakes, falling balls and more.
The npm package svelte-confetti-p5 receives a total of 12 weekly downloads. As such, svelte-confetti-p5 popularity was classified as not popular.
We found that svelte-confetti-p5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.