webcito/jquery-let-it-snow

一个小型jQuery插件,用于显示带有下雪效果的网站。

dev-main 2023-12-20 09:19 UTC

This package is auto-updated.

Last update: 2024-09-20 10:53:08 UTC


README

一个小型jQuery插件,用于显示带有下雪效果的网站。
此插件是在Tracy Good)的想法上创建的。

雪花数量由窗口宽度决定。如果窗口大小调整,雪花将重新计算。

let it snow picture

选项

let options = {
    background: null, // The background of the container. This property is set as css background.
    quantity: "smooth", // How many flakes should be produced? Possible values: smooth, less, medium or much
    flake: {
        html: "•", // Snow Entity
        minSize: 2, // Minimum Flake Size
        maxSize: 19, // Maximum Flake Size
    },
    colors: ["lightblue", "skyblue", "#DDDDDD", "#EEEEEE"], // Snowflake Colours
    speed: 0.75, // The speed of the falling flakes
    refresh: 50 // The time in milliseconds how the token should be calculated
}

示例

$('body').letItSnow({
    background: "fixed no-repeat center bottom url('demo/img/winter-landscape.png')",
    quantity: 'slowly',
    flake: {
        html: '<i class="bi bi-snow3"></i>'
    }
});