New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

data-ripple

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

data-ripple

Universal ripple effect solution

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

data-ripple

npm version GitHub license Size Downloads

Inspired by Material Design ripple effect.

Designed to be framework agnostic and work w/ modern SPA where state of app could be changed dynamically over time, so ripple options also will change.

Install

npm i data-ripple

Usage

Declarative

After importing module, declarative approach will find and init all elements w/ data-ripple attribute

import 'data-ripple';
<button data-ripple>Click me</button>
<div data-ripple>Click me</div>
<span data-ripple>Click me</span>

Imperative

import { rippleEffect, Ripple } from 'data-ripple';

...

const ripple = document.querySelector('#ripple');
new Ripple(ripple, { ... });

function handleMouseDown(e) {
  rippleEffect(e);
}

...
<button id="ripple">Click me</button>

<div onmousedown="handleMouseDown(event)">Click me</div>

Options

DeclarativeImperativeTypeDefaultDescription
colordata-ripple-colorstringcontrast (black/white) color for container background, 0.15 opacityRipple effect color (rgba, hsla, HEX)
timingFunctiondata-ripple-timing-functionstringcubic-bezier(0.4, 0, 0.2, 1)Animation timing function
opacitydata-ripple-opacitynumber1Ripple effect opacity value in range 0 - 1
sizeModifierdata-ripple-size-modifiernumber1Modifier for ripple effect size (radius)
enterDurationdata-ripple-enter-durationnumber550Value in ms for ripple effect fadeIn animation
exitDurationdata-ripple-exit-durationnumber400Value in ms for ripple effect fadeOut animation
disableCenteringdata-ripple-disable-centeringbooleanfalseBy default ripple effect animation will start under user mouse position. This option states for all ripples starts directly from container element center
fadeOutOnClickdata-ripple-fade-out-on-clickbooleanfalseBy default ripple effect will start on mouse down and will terminate only on pointe release. This options overrides this behaviour to execute ripple fadeOut directly after fadeIn animation

License

This project is licensed under the terms of the MIT license.

Keywords

ripple

FAQs

Package last updated on 13 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts