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 🙏

© 2026 – Pkg Stats / Ryan Hefner

raineverywhere

v0.1.0

Published

Transparent rain effects for any HTML element.

Readme

raineverywhere

一个与框架无关的 Vanilla JS 透明下雨效果 npm 包。它可以把雨效果叠加到任意 HTML 元素上,同时保留元素原本的内容和交互。

安装

npm install raineverywhere

JavaScript API

import { attachRain } from 'raineverywhere'

const link = document.querySelector('a')
const rain = attachRain(link)

// 需要时清理效果
rain.destroy()

也可以传 CSS 选择器:

attachRain('.hero-image')

HTML 属性方式

import { autoInit } from 'raineverywhere'

autoInit()
<a data-rain>这个链接原本的内容不会改变</a>
<img data-rain src="./photo.jpg" alt="雨中的图片" />

可用的数据属性:

<div
  data-rain
  data-rain-intensity="1.2"
  data-rain-speed="0.8"
  data-rain-opacity="0.9"
  data-rain-z-index="10"
></div>

参数

attachRain(element, {
  intensity: 1,
  speed: 1,
  opacity: 1,
  zIndex: 1000,
  maxDpr: 1.5,
  longDrops: 500,
  shortDrops: 500,
  longColor: '255,255,255',
  shortColor: '174,194,224',
})

默认情况下,雨滴数量会根据目标元素的面积自动缩放。需要完全固定数量时,可以显式传入 longDrops 和 shortDrops。

设计特点

  • 不修改目标元素的 innerHTML
  • 不需要包裹目标元素
  • 透明 Canvas,不遮挡元素原本内容
  • pointer-events: none,不会阻止链接、按钮等交互
  • 支持 img 等不能包含子元素的元素
  • 自动跟随滚动、窗口变化和元素尺寸变化
  • 不依赖 React、Vue 或其他前端框架