6bit.ch/html/js/sparks.js
root 39752c845a modified: index.html
new file:   js/art.js
	new file:   js/hdr.js
	new file:   js/hearts.js
	new file:   js/helpers.js
	new file:   js/particles.js
	new file:   js/qlpycon.js
	new file:   js/qlpyconbanner.js
	new file:   js/snek.js
	new file:   js/sparks.js
	new file:   js/stars.js
	modified:   slamp.html
	modified:   style.css
2026-06-14 14:08:52 +02:00

29 lines
626 B
JavaScript

$(function() {
var body = $('#starshine'),
template = $('.template.shine'),
stars = 500,
sparkle = 50;
var size = 'small';
var createStar = function() {
template.clone().removeAttr('id').css({
top: (Math.random() * 100) + '%',
left: (Math.random() * 100) + '%',
webkitAnimationDelay: (Math.random() * sparkle) + 's',
mozAnimationDelay: (Math.random() * sparkle) + 's'
}).addClass(size).appendTo(body);
};
for(var i = 0; i < stars; i++) {
if(i % 2 === 0) {
size = 'small';
} else if(i % 3 === 0) {
size = 'medium';
} else {
size = 'large';
}
createStar();
}
});