Ciao ragazzi volevo mostrarvi questo script
l'ho leggermente modificato, appena ritrovo la fonte originale dove c'è ne sono per tutti i gusti ve la posto
a me fa rabbrividire
l'unica pecca secondo me di questa tecnica è il consumo eccessivo di ram e cpu
voi che ne pensate?
HTML:
<!DOCTYPE html>
<html>
<head>
<title>HTML 5 Canvas</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>
html body {
text-align: center;
margin:0;
padding:0;
background-color: #000;
color:#FFF;
}
canvas {
padding:22px
}
</style>
</head>
<body>
<canvas id="c"></canvas>
<script>
k='px Impact';
with(t=(c=document.getElementById('c')).getContext('2d')){
w=c.width=500;
h=c.height=300;
a=strokeStyle='yellow';
lineWidth=0;
font=50+k;
textAlign='center';
strokeText('CRIRIC',z=118,z);
font=32+k
}
p=(b=t.getImageData(0,0,z*=2,z)).data;
Y=Math.random;
g=Array;
for(n=m=y=0;y<z;y++)
for(x=0;x<z;x++,m+=4)
if(p[m]){g[n]=x+x;g[n+4]=y+y;n+=8;
}
n/=8;
for(i=m=j=0;j<n+n;j++){
r=(Y()-.5)*w;s=(Y()-.5)*w;
g[m+1]=r+s;g[m+2]=-r;g[m+3]=-s;m+=4;
}
function go(){
if(!i){
for(i=m=j=0;j<n+n;j++){
r=Y()*w-z;
s=Y()*w-z;
g[m+1]=r+s;g[m+2]=-r;
g[m+3]=-s;m+=4;
}
}
t.fillStyle='#000';
t.fillRect(0,0,w,h);
t.fillStyle='yellow';
t.fillText('www.mrwebmaster.it',z,h-2);
t.fillStyle=a;p=1-i/z;p*=p;
for(m=j=0;j<n;j++){
v=p*p;
x=g[m++]+g[m++]*p+g[m++]*v+g[m++]*v*p;
y=g[m++]+g[m++]*p+g[m++]*v+g[m++]*v*p;
t.fillRect(x,y,3,3)
}
i++;
i%=z
if(i<230)
setTimeout("go()",9);
}
setTimeout("go()",1);
</script>
</body>
</html>
a me fa rabbrividire
l'unica pecca secondo me di questa tecnica è il consumo eccessivo di ram e cpu
voi che ne pensate?