@lorti/snow.js

Snowflakes

Usage no npm install needed!

<script type="module">
  import lortiSnowJs from 'https://cdn.skypack.dev/@lorti/snow.js';
</script>

README

Snowflakes ❄️

https://schneeflocken.netlify.com

Installation

npm install @lorti/snow.js

Usage

snow.js is a module that exports a snow() function, which you can pass the number of snowflakes you'd like and an HTML element where they should be drawn. You can for example bundle it using Parcel.

<!-- index.html -->
<style>
    #stage {
        width: 1280px;
        height: 720px;
        background: black;
    }
</style>
<div id="stage"></div>
<script src="./index.js"></script>
// index.js
import snow from '@lorti/snow.js';
const stage = document.getElementById('stage');
snow(10, stage);
parcel index.html