Skip to content

Instantly share code, notes, and snippets.

@Fusselwurm
Created June 27, 2014 16:07
Show Gist options
  • Save Fusselwurm/827892e1f528a8cca43c to your computer and use it in GitHub Desktop.
Save Fusselwurm/827892e1f528a8cca43c to your computer and use it in GitHub Desktop.
;)
(function () {
var
g = 'radial-gradient(farthest-corner at %spx %spx , transparent 0%, #f00 100%)',
t = 30000,
b = $(document.body),
d = $('<div></div>'),
f = function () {
var ww = $(window).width(), wh = $(window).height(),
x = g.replace('%s', ww / 2).replace('%s', wh / 2);
d.css('background', x).css('background','-webkit-' + x);
d.css('width', ww).css('height', wh).fadeIn(2000, function () {
d.fadeOut(2000, function () {
d.css('width', 0).css('height', 0);
setTimeout(f, Math.random() * t);
});
});
};
$.getScript('https://raw.githubusercontent.com/jquery/jquery-color/master/jquery.color.js');
d
.css('zIndex', 111)
.css('display', 'none')
.css('position', 'fixed')
.css('top', 0);
b.append(d);
setTimeout(f, t);
}());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment