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

touch-ripple

v0.1.6

Published

touch ripple

Downloads

7

Readme

touch-ripple

触摸涟漪反馈效果, 支持 颜色自定义,涟漪直径自定义和涟漪速度自定义, 不影响原有事件, 兼容移动端

查看DEMO

web多数的体验效果不佳是因为很多交互没有及时给出反馈, 特别是处理异步逻辑的时候用户需要等待, 如果按钮点击后没及时给出反馈就会让页面有卡顿的感觉,这个小插件就是为了解决触发某些动作之前的按钮反馈效果

安装方法

  • 方式一
npm install touch-ripple --save
  • 方式二
下载项目中的dist/touch-ripple.min.js, 然后用script标签插入到你的项目中, 如下
这种方式可以通过window.TouchRipple访问
<script type="text/javascript" src="dist/touch-ripple.min.js"></script>

使用方法

import TouchRipple from 'touch-ripple'

// 最简单的使用方法
new TouchRipple('.btn')

// 如果需要定义涟漪颜色可以这样初始化
new TouchRipple('.btn', 'rgba(0,0,0,0.2)')

// 如果还有其它设置 请这样写
new TouchRipple('.btn', {
  time: 500, // 涟漪散发时间
  color: 'rgba(0,0,0,0.2)', // 涟漪颜色
  size: 200 // 涟漪直径
}

参数说明

AnimateText接收两个参数, 例如: new AnimateText(element, options)

| 参数 | 类型 | 是否必填 | 描述 | | :---: | :--- | :---: | :--- | | element | String or Object | 是 | 可以是选择器或者dom节点对象(请保证这个节点内只有文本而没有其它节点) | | options | String or Object | 否 | 如果第二个参数是字符串, 则当作动画时间处理, 如果有其他参数, 以对象格式传递, 具体每个属性的描述请看下方的 options说明 |

options说明

第二个参数options详细说明

| 参数 | 类型 | 默认值 | 是否必填 | 描述 | | :---: | :--- | :---: | :---: | :--- | | color | String | rgba('0,0,0,0.2') | 否 | 涟漪颜色, 可以传入css能识别的颜色字符串 | | size | Number | element宽和高的较大值 | 否 | 涟漪直径 | | time | Number | 500 | 否 | 涟漪扩散时间 |