All Projects → v-trof → Ripple.js

v-trof / Ripple.js

Licence: other
Proper Material Design ripple effect for the web, that wouldn't interfere your elements' DOM.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Ripple.js

ripple-effect-click
Add ripple effect to any element you want when the click action happens ("ripple effect")
Stars: ✭ 15 (-16.67%)
Mutual labels:  ripple, ripple-effect
Primereact
The Most Complete React UI Component Library
Stars: ✭ 2,393 (+13194.44%)
Mutual labels:  ripple, ripple-effect
react-touch-ripple
Create ripple effect from Material Design with React
Stars: ✭ 27 (+50%)
Mutual labels:  ripple, ripple-effect
LoadersPack-Android
Android LoadersPack - a replacement of default android material progressbar with different loaders
Stars: ✭ 119 (+561.11%)
Mutual labels:  ripple, ripple-effect
safe-touch
⛓ Runtime optional chaining for JS
Stars: ✭ 71 (+294.44%)
Mutual labels:  javascript-library
sqlweb
SqlWeb is an extension of JsStore which allows to use sql query for performing database operation in IndexedDB.
Stars: ✭ 38 (+111.11%)
Mutual labels:  javascript-library
easevalidation
javascript validation library
Stars: ✭ 14 (-22.22%)
Mutual labels:  javascript-library
Glize
📚 Glize is a clean and robust pure Javascript library.
Stars: ✭ 16 (-11.11%)
Mutual labels:  javascript-library
v-bucket
📦 Fast, Simple, and Lightweight State Manager for Vue 3.0 built with composition API, inspired by Vuex.
Stars: ✭ 42 (+133.33%)
Mutual labels:  javascript-library
artunis-mobile
XRP Wallet app for Android and iOS, built in React Native.
Stars: ✭ 23 (+27.78%)
Mutual labels:  ripple
ethairballoons
A strictly typed ORM library for Ethereum blockchain.
Stars: ✭ 27 (+50%)
Mutual labels:  javascript-library
oojs-ui
OOUI is a modern JavaScript UI library with strong cross-browser support. It is the standard library for MediaWiki and Wikipedia. This is a mirror from https://gerrit.wikimedia.org. Main website:
Stars: ✭ 45 (+150%)
Mutual labels:  javascript-library
nojs
Library that helps minimize js you have to write
Stars: ✭ 118 (+555.56%)
Mutual labels:  javascript-library
ImagerJs
A JavaScript library for uploading images using drag & drop. Crop, rotate, resize, or shrink your image before uploading.
Stars: ✭ 101 (+461.11%)
Mutual labels:  javascript-library
Android-Animated-Theme-Manager
create your custom themes and change them dynamically with ripple animation
Stars: ✭ 540 (+2900%)
Mutual labels:  ripple
ionic-image-upload
Ionic Plugin for Uploading Images to Amazon S3
Stars: ✭ 26 (+44.44%)
Mutual labels:  javascript-library
DreamForgerJS
Interactive Fiction JS library
Stars: ✭ 14 (-22.22%)
Mutual labels:  javascript-library
aws-amplify-react-custom-ui
Building a Custom UI Authentication For AWS Amplify
Stars: ✭ 21 (+16.67%)
Mutual labels:  javascript-library
GifWriter.js
GIF (version 89a) Encoder written in TypeScript
Stars: ✭ 41 (+127.78%)
Mutual labels:  javascript-library
rel-events
The relevant React Events Library.
Stars: ✭ 20 (+11.11%)
Mutual labels:  javascript-library

Ripple.js • Code Climate Build Status

Dependency-free Material Design ripple effect for the web, that wouldn't interfere your elements' DOM.

  • Tiny (3kb gzipped, even less with your webpack)
  • Doesn't need a DOM node as a host, you can create ripples over inputs and images without hacks
  • Customizable
  • Capable of creating multiple ripples at once
  • Enlarges on mousedown, fades out on mouseup
  • Works with touch devices
  • Has simple API
  • Supports IE 10+
  • Runs smoothly (always 30+ fps) on low-end devices (with power of CSS3 transitions)

See a Demo

Getting Ripple.js

Like a vendor lib

Check the latest release

via npm

$ npm install proper-ripple --save-dev

via yarn

$ yarn add proper-ripple

Make sure to include it in your webpack (npm/yarn usage) (uses babel-loader with es-2015 preset & css-loader)

Usage

This is how you can tell Ripple.js to watch any element matching a selector (including dynamically added)

ripple.watch('#demo-2 button')

This is how you can add a listener to an element \ array of elements (DOM nodes)

var yourElement = document.querySelector('.login-button')
var manyNodes = document.querySelectorAll('button')

ripple.bindTo(yourElement) //will trigger on your element
ripple.bindTo(manyNodes) //will trigger on any of these

This is how you can remove all listeners (rippleBind is the same for ripple.bindTo)

var rippleBind = ripple.watch('#demo-2 button')
rippleBind.remove()

Customization

Full set of props

{
  color: "#fafafa", //{string} background color (like in CSS)
  opacity: 0.21, //{number} ripple max opacity (like in CSS)
  borderRadius: 'auto', //auto -- copy target props OR {Srting} CSS prop value
  borderWidth: 'auto',  //auto -- copy target props OR {number} CSS prop value !IN PX!
  zIndex: 999, //{number}
  transitionDuration: 500, //{number} in ms
  timingFunction: "cubic-bezier(.4,0`,.42,1)", //{string} transition timing function
  constant: false //{bool} enlarging speed is constant on any element size
}

Changing props

Way A

var rippleBind = ripple.watch('#demo-2 button')
rippleBind.factory.rippleProps = {
	opacity: 0.41,
	transitionDuration: 700,
} //it's a plain js object

rippleBind.factory.rippleProps.color = '#000'

Way B

var myProps = {
	color: '#000',
	opacity: 0.4,
	transitionDuration: 700
}

ripple.watch('#demo-2 button', myProps)
ripple.bindTo(manyNodes, myProps)

Way C

ripple.setDefaults({
	color: '#000',
	opacity: 0.41,
	transitionDuration: 700
})

Running tests

There are 2 ways to run tests for Ripple.js

  1. PhantomJS
  2. Browser mocha tests

Test's specs files are the same, but for the sake of PhantomJS they must be written in ES5

CLI PhantomJS testing

Assuming you have all devDependencies installed

$ npm test

Browser testing

$ npm run test-browser
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].