K ein paar Kleinigkeiten, sollte jetzt ein bisschen flüssiger laufen |
Ghost (Diskussion | Beiträge) K Fixes |
||
| Zeile 1: | Zeile 1: | ||
var letItSnow = | var letItSnow = | ||
{ | { | ||
snowPer100x100Pixels : 0.35, | snowPer100x100Pixels : 0.35, | ||
| Zeile 6: | Zeile 6: | ||
interval : null, | interval : null, | ||
loopindex : 0, | loopindex : 0, | ||
letItSnow : function(p) | letItSnow : function(p) | ||
{ | { | ||
| Zeile 37: | Zeile 37: | ||
this.y = 0 + Math.random()*window.innerHeight - (inWindow ? 0 : window.innerHeight); | this.y = 0 + Math.random()*window.innerHeight - (inWindow ? 0 : window.innerHeight); | ||
this.e = document.createElement("img"); | this.e = document.createElement("img"); | ||
this.e.src = " | this.e.src = "https://stargatewiki.de/images/3/36/SGW-Schnee.png"; | ||
this.e.alt = "*"; | this.e.alt = "*"; | ||
this.e.style.width = "30px"; | this.e.style.width = "30px"; | ||
| Zeile 46: | Zeile 46: | ||
this.e.style.zIndex = "100"; | this.e.style.zIndex = "100"; | ||
document.body.appendChild(this.e); | document.body.appendChild(this.e); | ||
this.fall = function() | this.fall = function() | ||
{ | { | ||
this.y += this.vy; | this.y += this.vy; | ||
if (this.y >= window.innerHeight) return true; | if (this.y >= window.innerHeight) return true; | ||
this.e.style.left = Math.floor(this.x + Math.sin(this.y*this.vx)*this.dx)+"px"; | this.e.style.left = Math.floor(this.x + Math.sin(this.y*this.vx)*this.dx)+"px"; | ||
this.e.style.top = Math.floor(this.y)+"px"; | this.e.style.top = Math.floor(this.y)+"px"; | ||
| Zeile 95: | Zeile 95: | ||
var img = document.createElement("img"); | var img = document.createElement("img"); | ||
img.alt = "Schneeanimation an- oder ausschalten"; | img.alt = "Schneeanimation an- oder ausschalten"; | ||
img.src = " | img.src = "https://stargatewiki.de/images/3/36/SGW-Schnee.png"; | ||
img.style.width = "24px"; | img.style.width = "24px"; | ||
img.style.height = "24px"; | img.style.height = "24px"; | ||