@mbrewerton/mb-snow
v1.0.1
Published
A customisable snowflake module for Angular 10+.
Maintainers
Readme
@mbrewerton/mb-snow
About
mb-snow is an Angular 10 module for adding a snowfall effect to your Angular applications.
It's customisable and extremely easy to use.
Usage
- Install mb-snow with npm:
npm i @mbrewerton/mb-snow. - Import the
MbSnowModulein your<name>.module.ts. - Add the
<mb-snow></mb-snow>component to any component in your application.
You can overwrite the following default values by passing them into the component:
minRadiusdefault: 1.5- The smallest size of snowflakes.
maxRadiusdefault: 3- The largest size of snowflakes.
minVelocitydefault: 0.75- Used as the lowest value for the snowflake velocity calculations.
maxVelocitydefault: 1.5- Used as the highest value for the snowflake velocity calculations.
swaydefault: true- Whether snowflakes should "sway" or fall straight down.
swayOffsetdefault: 5- The "offset" used to calculate potential sway. A higher value means higher potential sway on the X axis.
autoStartdefault: true- Whether the snowflakes should start falling on start. Note: There is currently no other way to initialise the snowflakes
amountdefault: 250- The amount used to calculate the number of snowflakes based on screen estate. A higher value means higher potential of snowflakes being created. Lower screen sizes will see less snowflakes.
forceAmountdefault: false- Forces the amount of snowflakes to be exactly what is passed to
[amount]- or its default.
- Forces the amount of snowflakes to be exactly what is passed to
zIndexdefault: 1- The
z-indexof the snowflake canvas.
- The
