• Stars
    star
    189
  • Rank 203,435 (Top 5 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created almost 10 years ago
  • Updated almost 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

vanilla Material Design ripples

rippleJS

Adds Material Design-style feedback ripples to your existing HTML without any dependencies. Show me the demos!

Usage

Include the rippleJS script (or use a local copy). Then, add elements with the rippleJS class within a parent element that has layout (aka, position: relative or position: absolute).

<button class="yourButton">
  Click Me
  <div class="rippleJS"></div>
</button>

<script async src="https://cdn.jsdelivr.net/npm/[email protected]"
    integrity="sha384-OlarGErerEgz/M7123pQTTek4pUIiR6t0BK09bTmWDi2cZYbv3VHrriaXDnA0Oup"
    crossorigin="anonymous"></script>
<!-- or if using ES6 modules -->
<script type="module">
  import 'https://cdn.jsdelivr.net/npm/[email protected]';
</script>

rippleJS adds handlers on document.body, so you don't need to register any new elements as you add them to the DOM. It supports touch and mouse events (even at the same time), and includes its own CSS.

Ripple Fill

By adding the fill class to a rippleJS element, the ripple will fill to rounded corners, good for form elements with fixed size. For example:

<div class="optHolder">
  <input type="checkbox" />
  <div class="rippleJS fill"></div>
</div>

Ripple Color

The default color is a transparent version of the current color (aka, the currentColor keyword). To change this default, add the following style rule:

.rippleJS .ripple {
  background: red;
}

You could also change it just for some elements:

.yourClassName .rippleJS .ripple {
  background: blue;
}

Or change the level of opacity:

.moreOpaque .rippleJS .ripple {
  opacity: 0.65;
}

Supports

Chrome, Safari, Firefox (all as of Dec 2014). Requires classList, so probably only supports IE10+.

Install

Instead of using rippleJS directly, you can fetch it using your favourite package manager:

$ bower install vanilla-ripplejs
$ npm install vanilla-ripplejs

You can either use ripple.min.js for a precompiled version to just drop into your site, or you could use lib.js included as a ES module. If you use lib.js, you'll need to include the CSS tooβ€”check out ripple.js for how this is done for the minified version, or you could just add the CSS to your regular styles.

More Repositories

1

kuto

Faster updates for big JS projects
TypeScript
509
star
2

gumnut

JS parser in Web Assembly / C
C
164
star
3

fast-text-encoding

Fast polyfill for TextEncoder and TextDecoder, only supports UTF-8
JavaScript
101
star
4

scoped

Scoped CSS polyfill
TypeScript
92
star
5

fastgif

fastgif, fast Web Assembly GIF decoder based on Wuffs
HTML
69
star
6

undoer

Native undo/redo behavior for web
JavaScript
56
star
7

srcgraph

ES6 module code splitting via custom parser and Rollup
JavaScript
44
star
8

viz-observer

Notifies your code on DOM node move or resize
TypeScript
24
star
9

but-csv

479 byte CSV parser and builder
JavaScript
23
star
10

mobile-first

Custom element to contain content within mock device πŸ“±
JavaScript
19
star
11

cjs-loader

πŸ”₯πŸ‘¨β€πŸ’»πŸ”₯ This is a successful but terrible idea and should not be used by anyone.
JavaScript
17
star
12

sre2

non-standard implementation of RE2 in Go
Go
17
star
13

wasm-game

Pixel game written with Web Assembly
C
15
star
14

but-unzip

small ~1k unzip library
JavaScript
15
star
15

hey-elon

Hey, Elon Chrome Extension
JavaScript
13
star
16

https-forward

A forwarding HTTPS server using Let's Encrypt
Go
12
star
17

html-modules-polyfill

HTML Modules Rewriter
JavaScript
12
star
18

typed-event-types

Typed events for EventTarget subclasses
JavaScript
11
star
19

advanced-input

Advanced <input> or <textarea> elements
JavaScript
9
star
20

dhost

Never-caching development Node webserver
JavaScript
8
star
21

async-transforms

Asynchronous stream transforms for easier and faster Node pipelines, i.e. build tools
JavaScript
7
star
22

esm-resolve

Resolves ESM imports in Node
TypeScript
7
star
23

parq

Parquet reader in JS
TypeScript
7
star
24

tiddlycsv

small, streaming CSV parser (~1kb)
TypeScript
7
star
25

fusebase

πŸ› οΈ FUSE filesystem backed on the πŸ”₯ Firebase Database
Go
4
star
26

nicehttp

Convenience library for HTTP handlers in Go
Go
4
star
27

tr51

Go library to process TR51 (aka Emoji πŸ€”πŸ—œοΈπŸ”¨πŸŽ‰) data
Go
4
star
28

daikin-go

Raw interface to Daikin AC units with WiFi dongles
Go
4
star
29

tiny-stable-stringify

Sorted version of JSON.stringify
TypeScript
4
star
30

polymer-closure

Demo project for compiling Polymer elements
HTML
3
star
31

shactions

Google Smart Home Actions in Go
Go
3
star
32

promises

The missing Promise helpers your JavaScript project needs
JavaScript
3
star
33

mocha-headless-server

Headless Mocha testing on a local HTTP server
JavaScript
3
star
34

11ty-fast-dev

11ty-fast-dev
JavaScript
2
star
35

thorish

Useful JS concepts and data structures
TypeScript
2
star
36

hangar

Local daemon for developing distributed Fly.io servers
Go
2
star
37

atvlib

Apple TV control library in Go
Go
2
star
38

base-project

Sam's base JS project
Shell
2
star
39

split-dom

Helper JavaScript to split DOM nodes within text
JavaScript
2
star
40

wattson

Wattson control library
Go
2
star
41

fileparts

File object which can have its properties modified independently.
JavaScript
2
star
42

unicodeshrugforyou

¯‍\‍_‍(‍ツ‍)‍_‍/‍¯
HTML
2
star
43

thrift-tools

Work with Thrift definitions and data
TypeScript
2
star
44

airhorn-overlay

Airhorn Web Component
JavaScript
2
star
45

radhist

Radical HTML history library
JavaScript
2
star
46

matcher

Gem matcher game demo
JavaScript
1
star
47

no-www

no-www hosting
Go
1
star
48

gulp-tweakdom

DOM manipulation in Gulp
JavaScript
1
star
49

syncingabout

JavaScript
1
star
50

lcatalk

LCA Talk 2018
HTML
1
star
51

valuefs

FUSE filesystem for historic values
Go
1
star
52

pysucks

Demonstration of a sane Python loader
Python
1
star
53

sents-cli

Command-line filesystem watcher with low dependencies
JavaScript
1
star
54

choose

PWA for choosing
JavaScript
1
star
55

purge-gcloud-app

Purge old gcloud deployed App Engine versions
JavaScript
1
star
56

JsTower

JavaScript
1
star
57

redirects-yaml

Helps you define redirects in a YAML file
JavaScript
1
star
58

samthor

<script>alert('hi');</script>
1
star
59

stitch-demo

TypeScript
1
star
60

ok-emoji

Finds whether an emoji is supported in the browser
JavaScript
1
star