Created
August 23, 2018 18:02
-
-
Save therealkevinard/70535e1b6f508cebe6baf3e9a7692e63 to your computer and use it in GitHub Desktop.
blech()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//-- 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