Add beautiful falling snowflakes to any website with a single line of code
![License](https://img.shields.io/badge/license-MIT-blue.svg) ![Size](https://img.shields.io/badge/size-2.5kb-brightgreen.svg) ![Pure JS](https://img.shields.io/badge/pure-javascript-yellow.svg) ---Add this single line of code to your website, right before the closing </body>
tag:
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
Thatโs it! Your website now has beautiful falling snowflakes! โ๏ธ
<!DOCTYPE html>
<html>
<head>
<title>My Winter Website</title>
</head>
<body>
<!-- Your website content -->
<!-- Add Snow Theme -->
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
</body>
</html>
// Default configuration
SnowTheme.config = {
snowflakes: ['โ', 'โ
', 'โ'], // Snowflake characters
density: 50, // Maximum number of snowflakes
interval: 200, // How often new snowflakes are created (ms)
minSize: 0.8, // Minimum snowflake size
maxSize: 1.5, // Maximum snowflake size
minDuration: 5, // Minimum fall duration (seconds)
maxDuration: 15, // Maximum fall duration (seconds)
wind: 20, // Wind effect strength
zIndex: 999999 // Layer level of snowflakes
}
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
<script>
SnowTheme.config.density = 30;
SnowTheme.config.interval = 300;
SnowTheme.config.maxSize = 1.2;
</script>
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
<script>
SnowTheme.config.density = 100;
SnowTheme.config.interval = 100;
SnowTheme.config.maxSize = 2;
SnowTheme.config.wind = 50;
</script>
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
<script>
SnowTheme.config.snowflakes = ['โ', 'โ', '*', '+'];
SnowTheme.config.minSize = 1;
SnowTheme.config.maxSize = 2;
</script>
<script src="https://ddosnotification.github.io/snow-theme/snow.js"></script>
<script>
SnowTheme.config.minDuration = 10;
SnowTheme.config.maxDuration = 20;
SnowTheme.config.wind = 10;
</script>
If snowflakes appear behind your content, adjust the z-index:
SnowTheme.config.zIndex = 1000000;
Check out the live demo: https://ddosnotification.github.io/snow-theme/demo.html
Perfect for:
MIT License - feel free to use in both personal and commercial projects.
Contributions are welcome! Feel free to:
density
valueinterval
valuemaxSize
valueIf you find this project useful, please consider:
Have questions? Found a bug? Please open an issue!
Made with โ๏ธ by ZeX