This project creates an enchanting snowfall effect on your webpage using simple HTML, CSS, and JavaScript. Snowflakes randomly fall from the top of the page at different speeds, sizes, and opacities, mimicking a realistic and mesmerizing snowfall.
To incorporate the snowfall effect into your webpage, follow these simple steps:
-
Clone or download this repository to your local machine.
-
Include the required CSS and JavaScript files in your HTML document:
<link rel="stylesheet" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.12.2/gsap.min.js"></script>
<script src="script.js"></script>
-
Insert a
div
element with the ID "container" where the snowflakes will descend:<div id="container"></div>
-
Open the
style.css
file and customize the background image according to your preference. -
Open the
script.js
file to fine-tune the snowfall effect parameters:- Adjust the number of snowflakes by modifying the loop count within the
for
loop. - Modify animation properties like speed, delay, blur, and more to achieve your desired visual effect.
- Adjust the number of snowflakes by modifying the loop count within the
Contributions are welcomed! If you have suggestions, enhancements, or bug fixes, please create a pull request.