Snow flakes in a vector field. Wind happens about once every 10 seconds, wind reset after each wind occurs.
b=document.body;f=[];h=600;m=Math;p=m.PI;t=0;r=m.random;q=m.round;w=0;b.style.background="black";b=b.children[0];b.height=b.width=h;c=b.getContext("2d");c.strokeStyle="#FFF";c.lineWidth=0.3;
function k(d,n){var g=r()/4*(q(r())?-1:1),i=r()+0.5,e,u=q(r()*100)+500,j=r()*3+2,l=j/6,o=j-4*l,s=3*l;this.d=function(){if(u--){n+=i+0.2;d+=g;if(d>h)d-=h;if(d<0)d=h-d;with(m){e=min(5,max(0,q(d/h)*6))+6*min(5,max(0,q(n/h)*6));i+=a[e]/400;g+=a[e+36]/80;if(abs(g)>10)g=10*(g<0?-1:1);if(abs(i)>10)i=10*(i<0?-1:1)}e=9;with(c){save();translate(d,n);rotate(p*r()/4);for(beginPath();e--;){lineTo(0,j);moveTo(0,o);lineTo(s,j-l);moveTo(0,o);lineTo(-s,j-l);moveTo(0,0);rotate(p/4)}stroke();closePath();restore()}}else{for(e in f)if(f[e]==
this)break;f.splice(e,1)}};f.push(this)}setInterval(function(){ii=73;if(w<=0)if(q(r()*100)){if(!w){a=[];for(w=-1;--ii;)a.push(r()*2-1)}}else{a=[];for(w=20;--ii>36;)a.push(1);for(;ii--;)a.push(4)}else w--;q(r()*2)||new k(r()*h,0);ii=f.length;for(c.clearRect(0,0,h,h);ii--;)f[ii].d();t++},50);
Yj1kb2N1bWVudC5ib2R5O2Y9W107aD02MDA7bT1NYXRoO3A9bS5QSTt0PTA7cj1tLnJhbmRvbTtxPW0ucm91bmQ7dz0wO2Iuc3R5bGUuYmFja2dyb3VuZD0iYmxhY2siO2I9Yi5jaGlsZHJlblswXTtiLmhlaWdodD1iLndpZHRoPWg7Yz1iLmdldENvbnRleHQoIjJkIik7Yy5zdHJva2VTdHlsZT0iI0ZGRiI7Yy5saW5lV2lkdGg9MC4zOw0KZnVuY3Rpb24gayhkLG4pe3ZhciBnPXIoKS80KihxKHIoKSk/LTE6MSksaT1yKCk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w=0;
b.style.background="black";
b=b.children[0];
b.height = b.width = h;
c = b.getContext('2d');
c.strokeStyle = "#FFF";
c.lineWidth = 0.3;
function k(x, y) {
var vx = r()/4 * (q(r()) ? -1 : 1),
vy = r()+0.5, n,
dc=q(r()*100)+500,
s = r()*3+2,
qs = s/6, qs2 = s - 4 * qs, qs3=3*qs;
this.d = function () {
if (!dc--) {
for (n in f) {
if (f[n] == this) break;
}
f.splice(n, 1);
return
}
// step
y += vy + 0.2;
x += vx;
if (x > h) x=x-h;
if (x < 0) x=h-x;
with(m) {
n = min(5, max(0, q(x/h)*6)) +
6 * min(5, max(0, q(y/h)*6));
vy += a[n]/400;
vx += a[n+36]/80;
if (abs(vx) > 10) {
vx = 10 * (vx < 0 ? -1 : 1);
}
if (abs(vy) > 10) {
vy = 10 * (vy < 0 ? -1 : 1);
}
}
n = 9;
with (c) {
save();
translate(x, y);
// end step
// random rotation
rotate(p*r()/4);
beginPath();
while (n--) {
lineTo(0, s);
moveTo(0, qs2);
lineTo(qs3, s - qs);
moveTo(0, qs2);
lineTo(-qs3, s - qs);
moveTo(0, 0);
rotate(p/4);
}
stroke();
closePath();
restore();
}
};
f.push(this);
}
setInterval(function () {
ii = 73;
if (w <= 0) {
if (!q(r()*100)) {
a= [];
w = 20;
while (--ii > 36) {
a.push(1);
}
while (ii--) {
a.push(4);
}
} else if (!w) {
a= [];
w = -1;
while (--ii) {
a.push(r()*2 - 1);
}
}
} else {
w--;
}
if (!q(r()*2)) {
new k(r()*h, 0);
}
ii=f.length;
c.clearRect(0, 0, h, h);
while (ii--) {
f[ii].d();
}
t++;
},50);