承接 remeritus/laravel-snowfall 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

remeritus/laravel-snowfall

最新稳定版本:v1.2.1

Composer 安装命令:

composer require remeritus/laravel-snowfall

包简介

A configurable snowfall effect for Laravel.

README 文档

README

Logo for laravel-snowfall

Add Snowfall to your Laravel Project

A configurable snowfall effect for Laravel applications. Add festive snow to your site easily with multiple layers, seasonal activation, and fully customizable settings.

Preview of remeritus/laravel-snowfall

Features

  • Multiple snow layers with configurable flake count, size, and speed.
  • Seasonal activation: automatically show snow between configurable start and end dates.
  • Blade directive: @snowfall for effortless inclusion.
  • Fully configurable via config/snowfall.php.
  • Lightweight, vanilla JS implementation using <canvas>.

Requirements / Compatibility

Dependency Version
Laravel ^10.0 | ^11.0 | ^12.0
PHP ^8.1 | ^8.2

Installation and Usage

1. Require the package

You can install this package via composer using:

composer require remeritus/laravel-snowfall

The package will automatically register its service provider.

2. Publish the configuration

To publish the config file to config/snowfall.php run:

php artisan vendor:publish --provider="Remeritus\Snowfall\SnowfallServiceProvider" --tag=config

3. Usage in Blade

Simply add @snowfall directive in your blade file, inside of the <body> tag, on the pages where you want the snowfall to appear:

<!DOCTYPE html>
<html lang="en">

<head>
    <!-- Metas, Styles, JS... -->
</head>

<body>
    @snowfall
    <!-- Your content... -->
</body>

</html>

4. Configuration

Edit config/snowfall.php to customize:

  • activate: Enable or disable globally.
  • start_date / end_date: Optional seasonal activation.
  • layers: Array of snow layers. Each layer supports:
    • flake_count: Number of flakes in this layer.
    • max_size: Maximum flake size.
    • max_speed: Maximum falling speed.
    • swing_min / swing_max: Side-to-side swinging amplitude.
  • color: Snow RGB color (e.g., '255,255,255').
  • opacity: Snow opacity (0.01.0).
  • canvas_z_index: Z-index of the snow <canvas>.

Example:

'layers' => [
    [
        'flake_count' => 60,
        'max_size' => 4,
        'max_speed' => 1,
        'swing_min' => 0.5,
        'swing_max' => 1.5,
    ],
    // Add more layers as needed
],

Environment Variables

You may override any configuration setting via .env. Here are the available keys:

Master switch
SNOWFALL_ENABLED=true

true → package loads and snow logic runs (default value)

false → package does nothing, no assets included

Mode control
SNOWFALL_MODE=seasonal

Possible values:

Value Description
seasonal Snow only appears between the configured dates (default value)
always Snow appears all the time
Seasonal dates
SNOWFALL_START_DATE=2025-12-01
SNOWFALL_END_DATE=2025-12-31

If not provided, the package defaults to:

December 1 → December 31 of the current year.

5. Notes

The snow is rendered via a <canvas> overlay with pointer-events: none so it won’t block user interaction. Works on all modern browsers with JavaScript enabled. Multiple layers create depth for a more realistic snowfall effect.

License

MIT License.

统计信息

  • 总下载量: 100
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-12-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固