All Projects → tomma5o → touchMyRipple

tomma5o / touchMyRipple

Licence: GPL-3.0 license
A simple library for apply the ripple effect where you want

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to touchMyRipple

Parvula
An extremely simple & flexible CMS generated from flat files with a complete RESTful API —
Stars: ✭ 76 (+300%)
Mutual labels:  light, simple
Server Manager
This repository holds the IntISP Interface. It can be rebuilt to interface with any other hosting panel.
Stars: ✭ 31 (+63.16%)
Mutual labels:  light, simple
Paper Ripple
Material Design Ripple effect in pure JS & CSS.
Stars: ✭ 55 (+189.47%)
Mutual labels:  ripple, effect
vue-rippler
🎉 Custom ripple effect plugin for @vuejs
Stars: ✭ 45 (+136.84%)
Mutual labels:  ripple, effect
Alfred Simple
Simple theme for Alfred
Stars: ✭ 217 (+1042.11%)
Mutual labels:  light, simple
Yui
Minimal vim color scheme
Stars: ✭ 93 (+389.47%)
Mutual labels:  light, simple
fluffy.js
🍱 Makes sure your content – no matter how big it is – will fit in any screen!
Stars: ✭ 47 (+147.37%)
Mutual labels:  light, simple
Mu
The μ css framework — a 1 ko css file.
Stars: ✭ 202 (+963.16%)
Mutual labels:  light, simple
graph-client
light zero dependency graphql-client, supporting cache and SSR
Stars: ✭ 27 (+42.11%)
Mutual labels:  light, simple
MatrixLib
Lightweight header-only matrix library (C++) for numerical optimization and machine learning. Contact me if there is an exciting opportunity.
Stars: ✭ 35 (+84.21%)
Mutual labels:  light, simple
EasyScrollDots
Single page scroll JavaScript plugin that allows for vertical navigation of page sections
Stars: ✭ 38 (+100%)
Mutual labels:  vanilla
Physics
experimenting with physics simulation
Stars: ✭ 53 (+178.95%)
Mutual labels:  simple
QuickNotes
一款简单、轻量、高效的Android记事、记账应用
Stars: ✭ 19 (+0%)
Mutual labels:  simple
lunar-theme
🌓 A minimal dark and light theme for Visual Studio Code. Handpicked colours, easy on the eyes, and perfect for coding in the day/night.
Stars: ✭ 24 (+26.32%)
Mutual labels:  light
DevFolio
A Modern Portfolio Template for Developers with easy setup process documented(with hosting).
Stars: ✭ 96 (+405.26%)
Mutual labels:  simple
svelte-micro
Light & reactive one-component router for Svelte
Stars: ✭ 81 (+326.32%)
Mutual labels:  light
FireSnapshot
A useful Firebase-Cloud-Firestore Wrapper with Codable.
Stars: ✭ 56 (+194.74%)
Mutual labels:  simple
Translucide
CMS efficient, léger, simple à prendre en main, customisable et écoconçu !
Stars: ✭ 31 (+63.16%)
Mutual labels:  light
magic-home
A .NET library that imports functionality from the Magic Home app, allowing control of smart lights.
Stars: ✭ 23 (+21.05%)
Mutual labels:  light
drawer
A touch-enabled drawer component for the modern web.
Stars: ✭ 26 (+36.84%)
Mutual labels:  vanilla

TouchMyRipple

touchMyRipple is a simple library that integrate ripple effect in your fantastic site!


Demo and Docs

Installation

Download Build

<script src="myDirectory/touchMyRipple.js"></script>

or

npm install touchmyripple --save

Basic Usage

index.js

import tmripple from 'touchmyripple';

tmripple.init({
    color: '#bada55', // default is 'rgba(255, 255, 255, 0.4)'
    eventListener: 'touchstart' // default is 'click'
});

tmripple.attachToSelectors({
    selectors: '#foo .bar [type=button]',
    color: 'rgba(0, 0, 0, 0.4)',
    eventListener: 'mousedown'
});

Methods

init(settings[Object])

This method enables ripple effect to all the elements that have the attribute data-animation="ripple".
All the following options are optional

settings[Object]

{
    // area is an option to make data-animation more specific
    area: 'class, id',

    // color...🤔 
    color: 'rgba, hex, hsla', 

    // pass the scrolling element if it's not window
    offsetEl: 'class, id',

    // this option accept an event listener 
    eventListener: 'event'
}

attachToSelectors(settings[Object])

This method enables ripple effect to all the elements that match the class passed in 'selectors'

settings[Object]

    {
        // selector of the element you want to attach the ripple ( is required )
        selectors: 'class, id',

        // color...🤔🤔🤔🤔🤔🤔
        color: 'rgba, hex, hsla',

        // pass the scrolling element if it's not window
        offsetEl: 'class, id',

        // this option accept an event listener 
        eventListener: 'event'
    }

React Usage

button.jsx

import withRipple from 'touchmyripple/react';

class Button extends Component {
  render() {
    return (
      <button {...this.props}>
        Hello <span>World</span>
      </button>
    );
  }
}

export default withRipple(Button, {
  color: "red",
  ignoreEls: { type: "secondary" }
});

app.js

class App extends React.Component {
  render() {
    const settingObj = {
      eventName: "click", 
      color: "blue"
    }

    return  <Button tmripple={settingObj} />
    // or use it with default settings: <Button  />
  }
}

settings[Object]

    {
        // default is "rgba(255,255,255,0.5)"
        color: 'rgba, hex, hsla',

        // this option accept an event listener for
        // differentiate smartphone event from desktop events
        // default is "click"
        eventListener: 'event',

        // ignore a specific element
        disabled: true

        // 🔺 this setting can be setted ONLY in the decorator function
        // you can create an object of key/value attributes to ignore
        ignoreEls: {class: "CTA_Button"}
    }
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].