Ripple-without-JS
Ripple-without-JS copied to clipboard
Create Material Design ripple effect in your HTML without using a single line of JS.
Ripple-without-JS
Create Material Design ripple effect in your HTML without using a single line of JavaScript code.
LIVE DEMO: https://kvaibhav01.github.io/Ripple-without-JS/
What's the output?
Here it is!

Fun isn't it?
How to achieve?
If there's no JS, then there's CSS. To achive the task we need to make a new CSS file having:
-
Container:
displayproperty set toflexto make it of same length regardless of the content. -
Ripple:
transformproperty set totranslate3dto define a 3D translation. -
Ripple-after: this is where the ripple effect ends. We can show something like a text but it doesn't make sense here. Therefore the
contenthas been set to"".background-image's value has been set to theradial-gradientfunction which takes in acircleas itsshape,#fffor white as thestart-colorandlast-colorastransparent 10.01%.transitionis used along withtransformwith its corresponding timing andopacity.
That's it! Simple, clean and Materialistic!
Read this article I wrote to incorporate this in your project file.