Skip to content

Instantly share code, notes, and snippets.

@therealkevinard
Created August 23, 2018 18:02
Show Gist options
  • Save therealkevinard/70535e1b6f508cebe6baf3e9a7692e63 to your computer and use it in GitHub Desktop.
Save therealkevinard/70535e1b6f508cebe6baf3e9a7692e63 to your computer and use it in GitHub Desktop.
blech()
//-- blech
var is_blech = false;
var blech_init = function () {
var css_str = "@keyframes strobe { 50% {background: purple;color: #00ee00;} } .strobe {animation-play-state: running;animation-duration: 100ms;} .strobe > a {animation-play-state: running;animation: strobe 100ms steps(1, end) infinite;}";
var css_node = document.createElement('style');
css_node.appendChild(document.createTextNode(css_str));
document.head.appendChild(css_node);
is_blech = true;
}
var blech = function () {
var $ = jQuery;
!is_blech ? blech_init();
$('a').each(function (i, el) {
$(el).parent().addClass('strobe');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment