Giter VIP home page Giter VIP logo

css-ripple-effect's Introduction

Pure CSS ripple effect (no JavaScript)

CSS-only implementation of Android Material design "ripple" animation on click event

Main advantage of this solution is that there is no DOM manipulation in order to create animation. That means this is faster - it doesn't use JavaScript or jQuery to animate.

This solution is also implemented in one of the biggest Bootstrap theming libraries Bootswatch in their Materia theme.

Demo

CSS ripple effect example

Installation

This library can be installed via npm

npm install css-ripple-effect

Or you can use yarn

yarn add css-ripple-effect --production

Or you can use bower

bower install css-ripple-effect

Or you can simply download it in your project, but that way you don't have the option to update if newer versions appear.

Supporters

css-ripple-effect's People

Contributors

mladenplavsic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

css-ripple-effect's Issues

Dark shadow

At github is a demonstration with white shadow which is just a picture . How can i get a white shadown (like on Bootswatch) instead of a gray shadow ?

Doesn't work on table-row

If display is set to table-row, the ripple starts from centre of the viewport and not the element's centre.

causes horizontal overflow issues on inline elements

I had an issue where I used this on general elements with no additional styles. Since is natively inline, the .ripple:after pseudoelement would take its size from the nearest block level element, but anchor its central coordinates with the . This led to horizontal overflow issues where there otherwise were none.

effect is not showing on bootstrap anchor tag button?

Issue

first of thanks for this pure CSS ripple effect, but there is some problem with it when using anchor tag <a class="btn btn-primary" href="login.html">Login</a> as a button, and clicking on the button, page redirect to login page, and the ripple effect is not showing.

Suggestion

when we click on button first ripple effect should show and then page get redirect :)

Hope this helps :)

Right clicking triggers the ripple

Probably want to restrict the ripple effect to only left click actions. Triggering the ripple on right click is misleading.

Tested in Windows 10 Chrome Version 55.0.2883.87 m (64-bit)

Click functionality breaks when used on button with font-awesome inside

May be this is not an issue and something out of my own error but i'm unable to figure it out and hence would like to seek your help for same.

When trying to implement the code in ripple.min.css on a button, following issues occur for reasons unknown to me:

  1. Click stops working! This is the button code:

  2. It blinks rather than 'ripple'

This is what '.customBtn ' looks like:
.customBtn {
position: fixed;
top: 50%;
font-size: 8em;
background-color: transparent;
color: grey;
outline: 0;
border: none;
}

This is what i've copied in my CSS (SCSS) from your code:
.ripple {
position: relative;
overflow: hidden;

&:after {
content: "";
display: block;
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
pointer-events: none;
background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
background-repeat: no-repeat;
background-position: 50%;
transform: scale(10,10);
opacity: 0;
transition: transform .5s, opacity 1s;
}

&:active, &:after {
transform: scale(0,0);
opacity: .2;
transition: 0s;
}
}

What is wrong in this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.