JSFiddle - React, Tailwind, and code Playground

by James

HTML

<div class="pulsate">Test</div>

CSS

.pulsate {
    background:#ccc;
    border:1px solid #666; 
    padding:5px;
    width:30px;
}

JavaScript

$(document).ready(function() {
    function pulsate() {
        $(".pulsate").animate({ opacity: 0.2 }, 1200, 'linear')
                     .animate({ opacity: 1 }, 1200, 'linear', pulsate)
                     .click(function() {
                         $(this).animate({ opacity: 1 }, 1200, 'linear');
                         $(this).stop();
                     });
        }

    pulsate();
});