Кусок мигающего кода
var textHolder = document.getElementsByTagName('div')[0],
text = textHolder.innerHTML,
chars = text.length,
newText = '',
i;
$("head style").append
(
"i{color:#"+parameters['image_text_color']+";}"+
" body\
{\
background: -moz-radial-gradient(center, ellipse cover, rgba(0,0,0,0.04) 0%, #"+parameters['image_background_color']+" 0%);\
background: -webkit-gradient(radial, center center, 0px, center center, 0%, color-stop(0%,rgba(0,0,0,0.04)), color-stop(0%,#"+parameters['image_background_color']+"));\
background: -webkit-radial-gradient(center, ellipse cover, rgba(0,0,0,0.04) 0%,#"+parameters['image_background_color']+" 0%);\
background: -o-radial-gradient(center, ellipse cover, rgba(0,0,0,0.04) 0%,#"+parameters['image_background_color']+" 0%);\
background: -ms-radial-gradient(center, ellipse cover, rgba(0,0,0,0.04) 0%,#"+parameters['image_background_color']+" 0%);\
background: radial-gradient(ellipse at center, rgba(0,0,0,0.04) 0%,#"+parameters['image_background_color']+" 0%);\
}"+ "i{font-family:'"+parameters['image_font_family']+"', Helvetica, Arial;font-size:"+parameters['image_font_size']+"px;}"+
"i{text-shadow: 0 0 "+parameters['image_font_shadow_width']+"px #"+parameters['image_font_shadow_color']+", 5px 9px 5px rgba(0, 0, 0, 0.5),"+
"0 0 10px #"+parameters['image_font_shadow_color']+","+
"0 0 100px #"+parameters['image_font_shadow_color']+","+
"0 0 500px #"+parameters['image_font_shadow_color']
+"}"
);
for (i = 0; i < chars; i += 1) {
newText += '<i>' + text.charAt(i) + '</i>';
}
textHolder.innerHTML = newText;
var letters = document.getElementsByTagName('i'),
flickers = [5, 7, 9, 11, 13, 15, 17],
randomLetter,
flickerNumber,
counter;
function randomFromInterval(from,to)
{
return Math.floor(Math.random()*(to-from+1)+from);
}
function hasClass(element, cls)
{
return (' ' + element.className + ' ').indexOf(' ' + cls + ' ') > -1;
}
function flicker()
{
counter += 1;
if (counter === flickerNumber)
{
return;
}
setTimeout
(
function ()
{
if(hasClass(randomLetter, 'off')) {
randomLetter.className = '';
}
else {
randomLetter.className = 'off';
}
flicker();
}, 30);
}
(function loop() {
var rand = randomFromInterval(500,3000);
randomLetter = randomFromInterval(0, chars - 1);
randomLetter = letters[randomLetter];
flickerNumber = randomFromInterval(0, 6);
flickerNumber = flickers[flickerNumber];
setTimeout(function() {
counter = 0;
flicker();
loop();
}, rand);
}());