Skip to content

Instantly share code, notes, and snippets.

@JacobBennett
Forked from anoopsankar/flicker-text.css
Created August 25, 2017 16:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobBennett/ac9d619944231ec19a8512cd029c0203 to your computer and use it in GitHub Desktop.
Save JacobBennett/ac9d619944231ec19a8512cd029c0203 to your computer and use it in GitHub Desktop.
CSS Flicker
#text-block .flickr {
color: transparent;
text-shadow: white 0 0 1px;
-webkit-transition: text-shadow 0.2s ease-in-out;
-moz-transition: text-shadow 0.2s ease-in-out;
transition: text-shadow 0.2s ease-in-out;
}
<div id="text-block">
I am a <span class="flickr">tubelight</span>
</div>
$(document).ready(function() {
setInterval(function() {
var val = 1;
if (Math.random() > 0.5) {
val = Math.floor((Math.random()*10)+1);
}
$(".flickr").css("text-shadow", "white 0 0 " + val + "px");
}, 200);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment