Entrega Patricinhas do Rock²
Autor: Nick♥ | Publicado: 2012-03-10T12:04:00-08:00

Segunda entrega para o blog: patricinhas do rock
Layout completo:|Dowload|
Favicon:cole os códigos a&nbsp;seguir em um gadget&nbsp;Html/Java script!!
Código do babadinho:&lt;div style=" background-image: url('http://i.imgur.com/7rx0a.png'); top: 0px; left: 0px; width: 100%; height: 50px; z-index: 100; position: fixed;"&gt;&lt;/div&gt;
Código das estrelinhas caindo do mouse:&nbsp;&lt;script type="text/javascript"&gt;
// &lt;![CDATA[
var colour="#696969";
var colour3="#DDA0DD";
var sparkles=70;

var x=ox=400;
var y=oy=300;
var swide=800;
var shigh=600;
var sleft=sdown=0;
var tiny=new Array();
var star=new Array();
var starv=new Array();
var starx=new Array();
var stary=new Array();
var tinyx=new Array();
var tinyy=new Array();
var tinyv=new Array();

window.onload=function() { if (document.getElementById) {
&nbsp; var i, rats, rlef, rdow;
&nbsp; for (var i=0; i&lt;sparkles; i++) {
&nbsp; &nbsp; var rats=createDiv(3, 3);
&nbsp; &nbsp; rats.style.visibility="hidden";
&nbsp; &nbsp; document.body.appendChild(tiny[i]=rats);
&nbsp; &nbsp; starv[i]=0;
&nbsp; &nbsp; tinyv[i]=0;
&nbsp; &nbsp; var rats=createDiv(5, 5);
&nbsp; &nbsp; var rats=createDiv3(5, 5);

&nbsp; &nbsp; rats.style.backgroundColor="transparent";
&nbsp; &nbsp; rats.style.visibility="hidden";
&nbsp; &nbsp; var rlef=createDiv(1, 5);
&nbsp; &nbsp; var rlef=createDiv3(1, 5);
&nbsp; &nbsp; var rdow=createDiv(5, 1);
&nbsp; &nbsp; var rdow=createDiv3(5, 1);
&nbsp; &nbsp; rats.appendChild(rlef);
&nbsp; &nbsp; rats.appendChild(rdow);
&nbsp; &nbsp; rlef.style.top="2px";
&nbsp; &nbsp; rlef.style.left="0px";
&nbsp; &nbsp; rdow.style.top="0px";
&nbsp; &nbsp; rdow.style.left="2px";
&nbsp; &nbsp; document.body.appendChild(star[i]=rats);
&nbsp; }
&nbsp; set_width();
&nbsp; sparkle();
}}

function sparkle() {
&nbsp; var c;
&nbsp; if (x!=ox || y!=oy) {
&nbsp; &nbsp; ox=x;
&nbsp; &nbsp; oy=y;
&nbsp; &nbsp; for (c=0; c&lt;sparkles; c++) if (!starv[c]) {
&nbsp; &nbsp; &nbsp; star[c].style.left=(starx[c]=x)+"px";
&nbsp; &nbsp; &nbsp; star[c].style.top=(stary[c]=y)+"px";
&nbsp; &nbsp; &nbsp; star[c].style.clip="rect(0px, 5px, 5px, 0px)";
&nbsp; &nbsp; &nbsp; star[c].style.visibility="visible";
&nbsp; &nbsp; &nbsp; starv[c]=50;
&nbsp; &nbsp; &nbsp; break;
&nbsp; &nbsp; }
&nbsp; }
&nbsp; for (c=0; c&lt;sparkles; c++) {
&nbsp; &nbsp; if (starv[c]) update_star(c);
&nbsp; &nbsp; if (tinyv[c]) update_tiny(c);
&nbsp; }
&nbsp; setTimeout("sparkle()", 40);
}

function update_star(i) {
&nbsp; if (--starv[i]==25) star[i].style.clip="rect(1px, 4px, 4px, 1px)";
&nbsp; if (starv[i]) {
&nbsp; &nbsp; stary[i]+=1+Math.random()*3;
&nbsp; &nbsp; if (stary[i]&lt;shigh+sdown) {
&nbsp; &nbsp; &nbsp; star[i].style.top=stary[i]+"px";
&nbsp; &nbsp; &nbsp; starx[i]+=(i%5-2)/5;
&nbsp; &nbsp; &nbsp; star[i].style.left=starx[i]+"px";
&nbsp; &nbsp; }
&nbsp; &nbsp; else {
&nbsp; &nbsp; &nbsp; star[i].style.visibility="hidden";
&nbsp; &nbsp; &nbsp; starv[i]=0;
&nbsp; &nbsp; &nbsp; return;
&nbsp; &nbsp; }
&nbsp; }
&nbsp; else {
&nbsp; &nbsp; tinyv[i]=50;
&nbsp; &nbsp; tiny[i].style.top=(tinyy[i]=stary[i])+"px";
&nbsp; &nbsp; tiny[i].style.left=(tinyx[i]=starx[i])+"px";
&nbsp; &nbsp; tiny[i].style.width="2px";
&nbsp; &nbsp; tiny[i].style.height="2px";
&nbsp; &nbsp; star[i].style.visibility="hidden";
&nbsp; &nbsp; tiny[i].style.visibility="visible"
&nbsp; }
}

function update_tiny(i) {
&nbsp; if (--tinyv[i]==25) {
&nbsp; &nbsp; tiny[i].style.width="1px";
&nbsp; &nbsp; tiny[i].style.height="1px";
&nbsp; }
&nbsp; if (tinyv[i]) {
&nbsp; &nbsp; tinyy[i]+=1+Math.random()*3;
&nbsp; &nbsp; if (tinyy[i]&lt;shigh+sdown) {
&nbsp; &nbsp; &nbsp; tiny[i].style.top=tinyy[i]+"px";
&nbsp; &nbsp; &nbsp; tinyx[i]+=(i%5-2)/5;
&nbsp; &nbsp; &nbsp; tiny[i].style.left=tinyx[i]+"px";
&nbsp; &nbsp; }
&nbsp; &nbsp; else {
&nbsp; &nbsp; &nbsp; tiny[i].style.visibility="hidden";
&nbsp; &nbsp; &nbsp; tinyv[i]=0;
&nbsp; &nbsp; &nbsp; return;
&nbsp; &nbsp; }
&nbsp; }
&nbsp; else tiny[i].style.visibility="hidden";
}

document.onmousemove=mouse;
function mouse(e) {
&nbsp; set_scroll();
&nbsp; y=(e)?e.pageY:event.y+sdown;
&nbsp; x=(e)?e.pageX:event.x+sleft;
}

function set_scroll() {
&nbsp; if (typeof(self.pageYOffset)=="number") {
&nbsp; &nbsp; sdown=self.pageYOffset;
&nbsp; &nbsp; sleft=self.pageXOffset;
&nbsp; }
&nbsp; else if (document.body.scrollTop || document.body.scrollLeft) {
&nbsp; &nbsp; sdown=document.body.scrollTop;
&nbsp; &nbsp; sleft=document.body.scrollLeft;
&nbsp; }
&nbsp; else if (document.documentElement &amp;&amp; (document.documentElement.scrollTop || document.documentElement.scrollLeft)) {
&nbsp; &nbsp; sleft=document.documentElement.scrollLeft;
&nbsp;sdown=document.documentElement.scrollTop;
&nbsp; }
&nbsp; else {
&nbsp; &nbsp; sdown=0;
sleft=0;
&nbsp; }
}

window.onresize=set_width;
function set_width() {
&nbsp; if (typeof(self.innerWidth)=="number") {
&nbsp; &nbsp; swide=self.innerWidth;
&nbsp; &nbsp; shigh=self.innerHeight;
&nbsp; }
&nbsp; else if (document.documentElement &amp;&amp; document.documentElement.clientWidth) {
&nbsp; &nbsp; swide=document.documentElement.clientWidth;
&nbsp; &nbsp; shigh=document.documentElement.clientHeight;
&nbsp; }
&nbsp; else if (document.body.clientWidth) {
&nbsp; &nbsp; swide=document.body.clientWidth;
&nbsp; &nbsp; shigh=document.body.clientHeight;
&nbsp; }
}





function createDiv(height, width) {
&nbsp; var div=document.createElement("div");
&nbsp; div.style.position="absolute";
&nbsp; div.style.height=height+"px";
&nbsp; div.style.width=width+"px";
&nbsp; div.style.overflow="hidden";
&nbsp; div.style.backgroundColor=colour;
&nbsp; return (div);
}



function createDiv3(height, width) {
&nbsp; var div=document.createElement("div");
&nbsp; div.style.position="absolute";
&nbsp; div.style.height=height+"px";
&nbsp; div.style.width=width+"px";
&nbsp; div.style.overflow="hidden";
&nbsp; div.style.backgroundColor=colour3;
&nbsp; return (div);
}
// ]]&gt;
&lt;/script&gt;Peço que coloque os créditos.Muito obrigada pela preferência!
.