Skip to content

Oh~It is rainy!render rainy window by canvas! 用 canvas 渲染下雨天的西窗。

Notifications You must be signed in to change notification settings

zhangshichun/rainy-window

Repository files navigation

rainy window

安装

yarn add rainy-window
# or
npm install rainy-window

也可以使用 cdn 直接引入:

https://unpkg.com/rainy-window@latest/dist/umd/index.js

使用

如果你在 webpackvite 项目中,你可以:

import rain from 'rainy-window'

rain('myImage', 'http://pic.zhangshichun.top/pic/20220606-02.jpg')

如果你是通过 cdn 引入的:

window.rain('OutsideTheWindow', 'http://pic.zhangshichun.top/pic/20220606-02.jpg')

在本项目里调试?

试试以下两个指令:

# 这是在简单html中通过umd打包的调试
yarn dev:umd
# 这是在vue3项目中通过 esm 打包的调试
yarn dev:esm

思路

写了一篇博客,欢迎点赞:《雨打西窗,再见那年夏天的暴雨⛈️》

About

Oh~It is rainy!render rainy window by canvas! 用 canvas 渲染下雨天的西窗。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published