Material Confirmation of Click

As a bit of an experiment for this site I wanted to mimic the confirmation of click/touch that Material design allows on apps.

Essentially its a circular colour that radiates out from where you touch to show the user that an action has taken place.

Here’s the basic structure of my links:

I have a little bit of jQuery where it adds a class to the circle element (the added class has a CSS animation attached to it) and adds a timer to the actual link so the animation has time to run.

The circle span has the following CSS:

… and when the runcircle class is added it does (width and height have to be bigger than the container its in to work):

The css animation is as follows:

Then as a bonus if you want to test the animation over and over to get it how you want, comment out (or remove) the window.location line so the ‘return false’ stops the link from working.

Then you can add this to remove the ‘runcircle’ class so you can see your animation, then click it again and again and again…

So if all goes to plan you should get a nice circle animation from the center of the container out.