webvpf/wn-christmas-plugin

圣诞节 - Winter CMS 插件。

安装: 17

依赖: 0

建议者: 0

安全性: 0

星标: 3

关注者: 1

分支: 0

开放问题: 0

类型: winter-plugin

v1.0.1 2021-12-12 07:56 UTC

This package is auto-updated.

Last update: 2024-09-12 14:18:13 UTC


README

plugin logo

圣诞节

为 Winter CMS 网站提供圣诞节装饰。

安装 Composer

composer require webvpf/wn-christmas-plugin

特性

  • 不与数据库交互
  • 无需 jQuery

组件

  • 圣诞花环
  • 下雪

圣诞花环

[ChristmasGarland]
dateOn = "01-01"
dateOff = "12-31"
==
{% component 'ChristmasGarland' %}

开启和关闭花环的日期格式为 mm-dd

[ChristmasSnow]
amount = 50
size = 5
speed = 1.5
wind = 0
color = "#fff"
opacity = 0.8
swing = 1
==
{% component 'ChristmasSnow' %}
  • amount - 同时显示的雪花数量。默认:50
  • size - 雪花大小。默认:5
  • speed - 雪花垂直下落的速度。值越高,雪花下落越快。默认:1.5
  • wind - 水平风能。正数时风会向右吹,负数时风会向左吹。默认:0
  • color - 雪花颜色。此参数接受十六进制颜色代码或 RGB,例如 #fff#ffffffrgb(255,255,255)。默认:#fff
  • opacity - 雪花的最大透明度。插件将生成从 0 到这个数字不同透明度的雪花。默认:0.8
  • swing - 雪花摇摆。如果您不希望雪花摇摆,将此参数设置为 0。默认:1

Winter CMS Demo 主题中花环输出示例

以下是在网站主页菜单下方插入花环的示例。根据这个原则,您可以将花环插入到模板中(以在所有页面上显示)。

进入 CMS 并打开 演示 页面。在标记的最开头,通过拖放插入 圣诞花环 组件。为了使花环显示正确,在 twig 之前添加与 ChristmasGarland 组件相同的样式,如示例所示。

<style>.jumbotron{padding-top:100px}.b-page_newyear{position:absolute;width:100%;height:100px;top:71px}</style>

{% component 'ChristmasGarland' %}

demo page content...

Screenshot of page with garland