npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mousesnow

v0.0.7

Published

鼠标移动特效

Downloads

48

Readme

MouseSnow

demo

安装

npm

npm i mousesnow

cdn

<script src="https://cdn.jsdelivr.net/npm/mousesnow/dist/index.min.js"></script>

使用

new MouseSnow(options);

参数

| 名称 | 默认值 | 类型 | 描述 | | ----------------------------------- | ---------- | ------------------------------ | -------------------------------------------------------------------------------- | | container | document | HTMLElement | 容器元素, 事件触发元素 | | isDisabled | false | boolean | 是否禁用雪花效果 | | character | "*" | string | 雪花字符 | | color | | Color | function():Color | 雪花颜色, 默认会在 #000000 - #ffffff 中随机获取一种颜色 | | size | "20px" | string | 初始雪花大小, | | lifeSpan | 120 | number | 生命周期, 生命周期小于 0 时,会销毁当前元素 | | destoryScalePercent | 0.2 | number | 销毁时的缩放比例, 因为在值太小时,视觉上已经不可见,提前销毁可以减少一些性能开销 | | throttle | 60 | number | 雪花移动的节流时间间隔, 单位: ms | | velocity | | function():{x:number,y:number} | 雪花移动速度, x 默认会在 -1 ~ 1 之间随机, y 默认为 1 | | downPointSnow | | boolean | object | 是否开启点击动画, false 为不开启, true 为默认设置 | | downPointSnow.isDisabled | false | boolean | 是否禁用点击动画 | | downPointSnow.num | 20 | number | 点击时出现的雪花个数 | | downPointSnow.color | | Color | function():Color | 雪花颜色, 如果没有设置,默认会取 options.color 的值 | | downPointSnow.size | "32px" | string | 雪花大小, 如果没有设置,默认会取 options.size 的值 | | downPointSnow.lifeSpan | 80 | number | 雪花生命周期, 如果没有设置,默认会取 options.lifeSpan 的值 | | downPointSnow.destoryScalePercent | 0.3 | number | 雪花销毁时的缩放比例, 如果没有设置,默认会取 options.destoryScalePercent 的值 | | downPointSnow.velocity | | function():{x:number,y:number} | 雪花移动速度, x 和 y 默认会在 -2 ~ 2 之间随机 |