datenspuren background raindrop & flash tuning

This commit is contained in:
Astro 2011-09-16 18:31:43 +02:00
parent 078c7dd426
commit 3cad78a2d7
2 changed files with 11 additions and 5 deletions

View File

@ -39,6 +39,12 @@ function Raindrop(x, y, speedX) {
this.el = $('<p class="backgroundraindrop"></p>');
this.el.text(''+Math.floor(Math.random() * 2));
var rotation = Math.floor(45 - (Math.random() * 90));
this.el.css('-webkit-transform', 'rotate('+rotation+'deg)');
this.el.css('-moz-transform', 'rotate('+rotation+'deg)');
this.el.css('-o-transform', 'rotate('+rotation+'deg)');
this.el.css('-ms-transform', 'rotate('+rotation+'deg)');
this.el.css('transform', 'rotate('+rotation+'deg)');
$('body').append(this.el);
this.render();
}
@ -92,7 +98,7 @@ Cloud.prototype.update = function() {
if (this.isDone())
this.el.detach();
else if (this.raining && Math.random() < 0.1)
new Raindrop(this.x + 8 + Math.random() * 48, this.y + 28, this.speedX);
new Raindrop(this.x + 8 + Math.random() * 48, this.y + 22, this.speedX);
};
Cloud.prototype.isDone = function() {
@ -121,8 +127,8 @@ function stepClouds() {
cloud1.y < cloud2.y + 40 &&
Math.random() < 0.01) {
new Flash(Math.floor((cloud1.x + cloud2.x) / 2),
Math.max(cloud1.y, cloud2.y) + 40);
new Flash(Math.floor((cloud1.x + cloud2.x) / 2 + 36),
Math.max(cloud1.y, cloud2.y) + 38);
cloud1.raining = true;
cloud2.raining = true;
}

View File

@ -496,11 +496,11 @@ td.event {
position: absolute;
width: 72px;
height: 40px;
z-index: -9;
z-index: -7;
}
.backgroundflash {
position: absolute;
z-index: -7;
z-index: -5;
}
.backgroundraindrop {
position: absolute;