Board logo

標題: 飄出來的字句 [打印本頁]

作者: 蛙    時間: 4-8-2013 08:42     標題: 飄出來的字句

*笨笨網站*  <<<  可隨意更改



<SCRIPT language=JavaScript>
var message = "*笨笨網站*";
var noOfFlyers = 10;
var blkCol = new Array("black","blue","red","green","blue","blue","red","black","red","green");
var blkFont = new Array("arial","timesroman","courier","verdana","timesroman","courier","arial","timesroman","courier",
"verdana");
var blkSize = new Array("22","14","10","28","29","10","22","24","26","10");
var blkIt = new Array("0","0","1","0","0","1","1","0","1","1");
var ie=document.all?1:0
var ns=document.layers?1:0
var err = 0;
var msgI=1;
var noOfMsgs;
function initialize()
{
if(!ns&&!ie) {
document.writeln("<center>"+finalmessage+"</center>");
document.writeln("<P><P><font face='arial' size=2>You are missing out on all the coolest stuff because of your outdated browser. Upgrade soon.</font>");
err=1;
return;
}
if(noOfFlyers<1||noOfFlyers>10) {handleErr("The number of flying blocks has been assigned an invalid value. Script will terminate.");return}
if(blkCol.length!=noOfFlyers) {handleErr("The list of block colours has an invalid length. Script will terminate.");return}
if(blkFont.length!=noOfFlyers) {handleErr("The list of block fonts has an invalid length. Script will terminate.");return}
if(blkSize.length!=noOfFlyers) {handleErr("The list of block font sizes has an invalid length. Script will terminate.");return}
self.moveTo(0,0);
self.resizeTo(screen.width,screen.height);
var msg = new String(message);
aOMsgs = msg.split(" ");
noOfMsgs = aOMsgs.length+1;
for(var i = 0; i<aOMsgs.length; i++)
{
for(var j = 1; j<=noOfFlyers; j++)
{
if(ie) document.writeln("<div id=\"fly"+String((i*noOfFlyers)+j)+"\" class=\"fly"+String(j)+"\" style=\"visibility:hidden\">"+aOMsgs[i]+"</div>");
if(ns) document.writeln("<layer id=\"fly"+String((i*noOfFlyers)+j)+"\" class=\"fly"+String(j)+"\" visibility=\"hidden\">"+aOMsgs[i]+"</layer>");
}
}
if(ie) document.write("<div id=\"mesg\" style=\"position:relative;color:black;visibility:hidden;font-family:arial;\"><center>"+finalmessage+"</center></div>");
if(ns) document.write("<layer id=\"mesg\" class=\"mesg\" visibility=\"hidden\"><center>"+finalmessage+"</center></layer>");

}
var msgCol=0;
function stop_flying()
{
if(ie){
document.all.mesg.style.visibility="visible";
document.all.mesg.style.color="rgb("+String(msgCol)+","+String(msgCol)+","+String(msgCol)+")";
}
if(ns){
setTimeout("document.layers['mesg'].visibility='visible'",1000);
return;
}
msgCol+=10;
if(msgCol<256) setTimeout("stop_flying()",10);
else return;
}
function fly_txt(dataID)
{
this.objID = dataID;
var screen_x = screen.width;
var screen_y = screen.height;
var window_x = 0.9*screen_x;
var window_y = 0.6*screen_y;
var x;
x=0.6*Math.random();
if(x>0.3) x+=0.4;
this.start_x = Math.round(window_x*x);
this.start_y = Math.round(window_y*Math.random());
if(x>0.3) x=0.3*Math.random();
else x=0.7+0.3*Math.random();
this.stop_x = Math.round(window_x*x);
this.stop_y = Math.round(window_y*Math.random());
this.slope = (this.stop_y - this.start_y)/(this.stop_x - this.start_x);
this.speed = Math.round(Math.random()*2)+4;
if(ns) this.speed-=2;
this.steps = Math.round(Math.abs(this.start_x-this.stop_x)/this.speed);
this.curCol = 0;
this.curI = 0;
this.timerID = 0;
if(ie) this.objStyle = eval("document.all(\""+this.objID+"\").style");
if(ns) this.objStyle = eval("document.layers[\""+this.objID+"\"]");
var tmp = (parseInt(dataID.substring(3))-1)%noOfFlyers;
if(ie) {
this.color=blkCol[tmp];
this.objStyle.fontFamily=blkFont[tmp];
this.objStyle.fontSize=blkSize[tmp]+"pt";
this.objStyle.fontStyle=(parseInt(blkIt[tmp])?"italic":"normal");
}
this.Animate = animate_fly;
}
function animate_fly()
{
if(ie){
this.objStyle.pixelLeft = this.start_x+this.curI;
this.objStyle.pixelTop = (this.slope*this.curI) + this.start_y;
}
if(ns){
this.objStyle.left = this.start_x+this.curI;
this.objStyle.top = (this.slope*this.curI) + this.start_y;
}
this.objStyle.visibility="visible";
if(this.stop_x>this.start_x) this.curI+=this.speed;
else this.curI-=this.speed;
if(ie){
var tmp;
switch(this.color){
case "white":
tmp=String("rgb("+String(this.curCol)+","+String(this.curCol)+","+String(this.curCol)+")");
break;
case "red":
tmp=String("rgb("+String(this.curCol)+",0,0)");
break;
case "blue":
tmp=String("rgb(0,0,"+String(this.curCol)+")");
break;
case "green":
tmp=String("rgb(0,"+String(this.curCol)+",0)");
break;
default:
}
this.objStyle.color=tmp;
if(this.steps>50){
if(Math.abs(this.curI/this.speed)<25) this.curCol+=10;
if(Math.abs(this.curI/this.speed)>(this.steps-25)) this.curCol-=5;
}
}
if(Math.abs(this.start_x+this.curI-this.stop_x)<=this.speed) {
clearInterval(this.timerID);
this.timerID=0;
this.objStyle.visibility="hidden";
var end=0;
for(var i=1; i<=noOfFlyers; i++)
if(fly[i].timerID) end=1;
if(!end)
if(msgI<noOfMsgs) start_flying(msgI++);
else stop_flying();
}
}
var fly = new Array(11);
function start_flying(msgIndex)
{
if(err) return;
for(var s=1; s<=noOfFlyers; s++)
{
fly[s] = new fly_txt("fly"+String((msgIndex-1)*noOfFlyers+s));
}


for(s=1;s<=noOfFlyers;s++)
{
var cmd = "fly["+s+"].Animate()";
fly[s].timerID = setInterval(cmd,10);
}

}

function handleErr(errMsg)
{
alert(errMsg);
err=1;
return false;
}
//-->
</SCRIPT>

<STYLE type=text/css>.fly1 {
COLOR: white; FONT-FAMILY: arial; FONT-SIZE: 22pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly2 {
COLOR: white; FONT-FAMILY: timesroman; FONT-SIZE: 24pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly3 {
COLOR: white; FONT-FAMILY: gothic; FONT-SIZE: 26pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly4 {
COLOR: white; FONT-FAMILY: arial; FONT-SIZE: 28pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly5 {
COLOR: white; FONT-FAMILY: courier; FONT-SIZE: 29pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly6 {
COLOR: white; FONT-FAMILY: arial; FONT-SIZE: 22pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly7 {
COLOR: white; FONT-FAMILY: timesroman; FONT-SIZE: 20pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly8 {
COLOR: white; FONT-FAMILY: gothic; FONT-SIZE: 22pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly9 {
COLOR: white; FONT-FAMILY: arial; FONT-SIZE: 24pt; FONT-WEIGHT: bold; POSITION: absolute
}
.fly10 {
COLOR: white; FONT-FAMILY: courier; FONT-SIZE: 25pt; FONT-WEIGHT: bold; POSITION: absolute
}
.mesg {
COLOR: white; FONT-FAMILY: arial; POSITION: relative
}
</STYLE>
<STYLE type=text/javascript>
for(var k = 1; k<=noOfFlyers; k++){
document.classes["fly"+String(k)].all.color=blkCol[k-1];
document.classes["fly"+String(k)].all.fontFamily=blkFont[k-1];
document.classes["fly"+String(k)].all.fontSize=blkSize[k-1]+"pt";
document.classes["fly"+String(k)].all.fontStyle=(parseInt(blkIt[k-1])?"italic":"normal");
}
</STYLE>
<body bgColor="#ffffff" onload="start_flying(msgI++)" text="#000000">
<SCRIPT language=JavaScript>
initialize();
</SCRIPT>
作者: 蛙    時間: 4-8-2013 08:44








歡迎光臨 笨笨網站超級論壇 (http://www.bunbunhk.com/BBS/Discuz/) Powered by Discuz! 6.0.0