Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
CSS Flicker Full
<!DOCTYPE html>
<html>
<head>
<title>Flickering Text</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<style>
body {
background: #666;
background-image: url('txture.png');
padding: 1em;
font-size: 36px;
font-family: 'DejaVu Serif', 'Georgia', serif;
}
#text-block {
color: white;
text-shadow: white 0 0 3px;
font-size: 1.5em;
}
#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;
/* Transitions defined for smoother anim. */
}
#wrap {
margin-top: 50px;
width: 100%;
}
#logo {
margin: auto;
width: 500px;
text-align: center;
}
</style>
</head>
<body>
<div id="wrap">
<div id="logo">
<div id="text-block">
i am a <span class="flickr">bad</span> lamp
</div>
</div>
</div>
<script type="text/javascript">
$(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);
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment