# easy-snowfall **Repository Path**: wavef/easy-snowfall ## Basic Information - **Project Name**: easy-snowfall - **Description**: 🌨️ Easy-Snowfall 是一个轻量级的 JavaScript 库,用于在网页中生成漂亮的雪花动画效果。它支持高度定制,用户可以通过简单的配置创建不同的雪花风格,为网站增添冬日氛围。 - **Primary Language**: JavaScript - **License**: AGPL-3.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2025-01-08 - **Last Updated**: 2025-01-08 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Easy-Snowfall 🌨️ **Easy-Snowfall** is a lightweight JavaScript library for creating beautiful snowfall animations on web pages. Highly customizable, it allows users to create different snowflake styles effortlessly, adding a touch of winter magic to your website. 🌨️ **Easy-Snowfall** 是一个轻量级的 JavaScript 库,用于在网页中生成漂亮的雪花动画效果。它支持高度定制,用户可以通过简单的配置创建不同的雪花风格,为网站增添冬日氛围。 --- ## Features | 特性 - 🎨 **Highly Customizable**: Adjust the number, size, opacity, speed, and swing amplitude of snowflakes. - 🎨 **高度自定义**:支持调整雪花数量、大小、透明度、速度、摆动幅度等参数。 - 📱 **Responsive Design**: Automatically adapts to screen size changes, perfect for both desktop and mobile. - 📱 **响应式设计**:自动适配屏幕尺寸变化,适用于桌面和移动端。 - ⚡ **Great Performance**: Smooth animations using native Canvas, with low resource consumption. - ⚡ **性能优异**:使用原生 Canvas 实现,动画流畅,占用资源少。 - 🚀 **Easy to Use**: Integrate into any webpage with just a few lines of code. - 🚀 **开箱即用**:只需几行代码即可快速集成到任意网页中。 --- ## Quick Start | 快速开始 ### Installation | 安装 Download the script directly or install via npm: 直接下载脚本或通过 npm 安装: ```bash npm install easy-snowfall ``` ### Example | 示例 Add a `` tag in your HTML file and initialize Snowfall: 在 HTML 文件中添加一个 `` 标签,并初始化 Snowfall: ```html ``` --- ## Configuration | 配置参数 | Parameter | Type | Default | Description | |-----------------|-----------|---------------|-----------------------------------------| | 参数名称 | 类型 | 默认值 | 描述 | | `flakeCount` | `number` | `100` | Number of snowflakes | 雪花数量 | | `radiusRange` | `Array` | `[2, 5]` | Snowflake radius range | 雪花半径范围 | | `opacityRange` | `Array` | `[0.5, 1]` | Snowflake opacity range | 雪花透明度范围 | | `speed` | `number` | `1` | Falling speed multiplier | 雪花下落速度倍数 | | `swingAmplitude`| `number` | `0` | Swing amplitude | 雪花左右摆动幅度 | --- ## Compatibility | 兼容性 - Supports all major modern browsers (Chrome, Firefox, Edge, Safari). - 支持主流现代浏览器(Chrome、Firefox、Edge、Safari)。 - Mobile-friendly, works well on iOS and Android devices. - 移动端友好,适配 iOS 和 Android 系统。 --- ## License | 许可证 This project is licensed under the [AGPL-3.0 License](LICENSE). Contributions and forks are welcome! 本项目基于 [AGPL-3.0 License](LICENSE) 开源,欢迎贡献与分支!