Fantasmas en el blog – Promotional Code – Dominios


Para quienes les gustadisfrazar su blog en Halloween, o para quienes les gusta tener adornos macabros en el blog, este script les ayudará a darle ese aspecto de terror con unosfantasmas volando por todo el blog.
Puedes ver el ejemplo eneste blog poseído de pruebas.

Ponerlo en el blog es sumamente sencillo, sólo basta entrar enDiseño | Elementos de la página | Añadir gadget | HTML/Javascript y ahí pegar este código:
script language="JavaScript"
if ((document.getElementById) &&
window.addEventListener || window.attachEvent){
(function(){

//Configuracion

var numberOfGhosts = 10;/* Numero de fantasmas */
var ghostSpeed = 0.9;/* Velocidad */
var inTheFace = 5;
var setTimeOutSpeed = 50;/* Velocidad a la que desaparecen */

//Fin de la configuracion

var h,y,cy,cx,sy,sx,ref,field,oy1,oy2,ox1,ox2,iy1,iy2,ix1,ix2;
var d = document;
var domWw = (typeof window.innerWidth == "number");
var domSy = (typeof window.pageYOffset == "number");
var pi1 = 180/3.14;
var pi2 = 3.14/180;
var y = [];
var x = [];
var strs = [];
var gro = [];
var dim = [];
var dfc = [];
var vel = [];
var dir = [];
var acc = [];
var dtor = [];
var xy2 = [];
var idx = document.getElementsByTagName('div').length;
var zip = [];
var pix = "px";

for (i = 0; i numberOfGhosts; i++){
document.write('div id="ghosts'+(idx+i)+'"'
+' style="position:absolute;top:0px;left:0px;'
+'width:40px;height:40px;background-color:transparent;'
+'font-size:0px;"img src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiJaDHwwDIVDVKLPQ0Iquv_Ybt1jIRA34GxVrZoWErI4lZf5VQy37XQ5vyoPPdgbwxaApRmHuq2dxIggcc1JGKyKVZLKsHzt49VAwBJ5byFnn0XQPj8LevgZOZ_rubjJB9oDgfvsrRNF7c/s1600/ghost.gif" class="ghost" width="70"//div');
}

if (domWw) ref = window;
else{
if (d.documentElement &&
typeof d.documentElement.clientWidth == "number" &&
d.documentElement.clientWidth != 0)
ref = d.documentElement;
else{
if (d.body &&
typeof d.body.clientWidth == "number")
ref = d.body;
}
}

function win(){
var mozBar = ((domWw) &&
ref.innerWidth != d.documentElement.offsetWidth)?20:0;
h = (domWw)?ref.innerHeight:ref.clientHeight;
w = (domWw)?ref.innerWidth - mozBar:ref.clientWidth;
cy = Math.floor(h/2);
cx = Math.floor(w/2);

oy1 = (75 * h / 100);
oy2 = (oy1 / 2);
ox1 = (75 * w / 100);
ox2 = (ox1 / 2);

iy1 = (18 * h / 100);
iy2 = (iy1 / 2);
ix1 = (18 * w / 100);
ix2 = (ix1 / 2);

field = (h w)?h:w;
}

function rst(s){
var cyx;
sy = (domSy)?ref.pageYOffset:ref.scrollTop;
sx = (domSy)?ref.pageXOffset:ref.scrollLeft;
acc[s] = 0;
dim[s] = 1;
xy2[s] = 0;
cyx = Math.round(Math.random() * 2);
if (cyx == 0){
y[s] = (cy - iy2) + Math.floor(Math.random() * iy1);
x[s] = (cx - ix2) + Math.floor(Math.random() * ix1);
}
else{
y[s] = (cy - oy2) + Math.floor(Math.random() * oy1);
x[s] = (cx - ox2) + Math.floor(Math.random() * ox1);
}
dy = y[s] - cy;
dx = x[s] - cx;
dir[s] = Math.atan2(dy,dx) * pi1;
dfc[s] = Math.sqrt(dy*dy + dx*dx) ;
zip[s] = 10 * (dfc[s] + inTheFace) / 100;
vel[s] = ghostSpeed * dfc[s] / 100;
dtor[s] = (field - dfc[s]);
if (dtor[s] 1) dtor[s] = 1;
gro[s] = 0.003 * dtor[s] / 100;
}

function animate(){
for (i = 0; i numberOfGhosts; i++){
y[i] += vel[i] * Math.sin(dir[i] * pi2);
x[i] += vel[i] * Math.cos(dir[i] * pi2);
acc[i] = (vel[i] / (dfc[i] + (vel[i] * zip[i])) * vel[i]);
vel[i] += (acc[i]);
dim[i] += gro[i] + acc[i] / zip[i];
xy2[i] = dim[i] / 2;
if (y[i] 0 + xy2[i] ||
x[i] 0 + xy2[i] ||
y[i] h - xy2[i] ||
x[i] w - xy2[i]){
rst(i);
}
strs[i].top = (y[i] - xy2[i]) + sy + pix;
strs[i].left = (x[i] - xy2[i]) + sx + pix;
strs[i].width = (strs[i].height = (Math.round(dim[i])) + pix);
}
setTimeout(animate,setTimeOutSpeed);
}

function init(){
win();
for (i = 0; i numberOfGhosts; i++){
strs[i] = document.getElementById("ghosts"+(idx+i)).style;
rst(i);
}
animate();
}

if (window.addEventListener){
window.addEventListener("resize",win,false);
window.addEventListener("load",init,false);
}
else if (window.attachEvent){
window.attachEvent("onresize",win);
window.attachEvent("onload",init);
}
})();
}//End.

/script

style
.ghost {
filter:alpha(opacity=30);
-moz-opacity: 0.3;
opacity: 0.3;
-khtml-opacity: 0.3;
}
html {
overflow-x:hidden;
}
/style

Con eso ya tendrán los fantasmas merodeando el blog. Se pueden modificar algunos valores de velocidad al gusto, esos se modifican en las anotaciones que he puesto en colorverde.

NOTA: En las plantillas del diseñador de Blogger no funciona muy bien. Raro ¿no?

mesothelioma lawyer california adverse remortgage primary pulmonary hypertension Nunavut culture DUI lawyer PSYCHIC FOR FREE Criminal Defense Attorneys Florida Register free domains Php programmers Casino att call conference Tech school Social media tools illinois law lemon WordPress themes for designers mesotheolima How to Donate A Car in California Casino reviews sell structured settlement calculator Car Insurance in South Dakota Online casino meso lawyer Psd to WordPress Social media platforms new york mesothelioma law firm car insurance in south dakota holland michigan college Hard drive data recovery services what is structured settlement mesothelioma lawyer chicago Online Criminal Justice Degree Mobile casino Make money online Australia quotes car domains yahoo Futuristic architecture Donate Car To Charity CALIFORNIA Home Phone Internet Bundle Php programmers for hire structured settlement agreement Criminal lawyer Criminal defense lawyer Nunavut Culture How to donate a car in California Live casino PHD on Counseling Education DAYTON FREIGHT LINES Adobe illustrator classes Computer science classes online low credit line credit cards Dallas Mesothelioma Attorneys Injury Lawyers Donate Car to Charity California Hire php developers cheap auto insurance in va DONATE CARS ILLINOIS domain yahoo ONLINE MOTOR INSURANCE QUOTES Better Conference Calls anti spam appliance Asbestos Lawyers structured settlemen Low credit line credit cards Cheap Car Insurance in Virginia mortgage adviser buyers of structured settlements business voice mail service Hire php programmers phd in counseling education Dwi lawyer benchmark lending Custom Christmas cards EMAIL BULK SERVICE Cheap car insurance for ladies onlineclasses asbestos exposure lawyers mesothelioma suit Best social media platforms DONATE CARS IN MA LOW CREDIT LINE CREDIT CARDS structured settlement broker REGISTER FREE DOMAINS Mortgage Adviser Donate Cars Illinois cheap car insurance in virginia Service business software Social media strategies mesothelioma Donate a Car in Maryland Social media management Donating a Car in Maryland Hire php developer motor insurance quotes accident attorney orange county Cheap Auto Insurance in VA car insurance companies best criminal lawyer in arizona Social media platforms for business Bankruptcy lawyer mesothelioma ct Cheap Domain Registration Hosting mesothelioma compensation harddrive data recovery services mesothelioma law firms Seo companies Best social media platforms for business Automobile Accident Attorney Mortgage adviser miami personal injury attorney lease management software Donate Cars in MA New social media platforms la personal injury lawyer MOTOR REPLACEMENTS Business finance group

Share: