模拟黑客帝国的网页特效代码

广告

       
还记得《黑客帝国》这个电影吗?
       
电影里面的人用的电脑都是一堆数字从上往下不断地移动的,感觉真的很帅。那么今天就让我们来重新演译这个画面吧。

       
在网页中输入一下代码:
<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0 Transitional//EN”>
<HTML><HEAD><TITLE>这里输入标题</TITLE>
<META HTTP-EQUIV=”REFRESH” CONTENT=”30″; URL=””>
<SCRIPT language=javascript type=text/javascript></SCRIPT>
<META http-equiv=Content-Type content=”text/html; charset=gb2312″>
<SCRIPT language=javascript>
<!–
function Is() {
   
var agent = navigator.userAgent.toLowerCase();
   
this.major = parseInt(navigator.appVersion);
   
this.minor = parseFloat(navigator.appVersion);
   
this.ns  = ((agent.indexOf(‘mozilla’)!=-1) && ((agent.indexOf(‘spoofer’)==-1) && (agent.indexOf(‘compatible’) == -1)));
   
this.ns2 = (this.ns && (this.major == 2));
   
this.ns3 = (this.ns && (this.major == 3));
   
this.ns4b = (this.ns && (this.major == 4) && (this.minor <= 4.03));
   
this.ns4 = (this.ns && (this.major >= 4));
   
this.ie   = (agent.indexOf( “msie”) != -1);
   
this.ie3  = (this.ie && (this.major == 2));
   
this.ie4  = (this.ie && (this.major >= 4));
   
this.op3 = (agent.indexOf( “opera”) != -1);
}
var is = new Is()
if(is.ns4) {
   
doc = “document”;
   
sty = “”;
   
htm = “.document”
} else if(is.ie4) {
   
doc = “document.all”;
   
sty = “.style”;
   
htm = “”
}
var text1 = “”, text2 = “”, count = 0, count2=0;
msg = new Array();

msg[0] = “语句1(可以在语句前输入“<center>”使所有的语句处于页面的中间”;
msg[1] = “语句2”;
msg[2] = “语句3(可以输入“<font face=tahoma size=*>”来设置字体的大小,“*”改成你要的数值。”;
msg[3] = ” 语句4″;
msg[4] = ” 语句语句5″;
msg[5] = “语句6”;
msg[6] = “语句7”;
msg[7] = “语句8”;
msg[8] = “语句9”;
msg[9] = “语句10”;
msg[10] = “语句11”;
msg[11] = “语句12”;
msg[12] = “语句13”;
text = msg[0].split(“”);
function writetext(){
 
text1 =’ <tt>’+text2 + ‘<b style=”color:#00FF00″>’+text[count]+'</center></tt>’;
 
text2 += text[count];
 
fillHTML = eval(doc + ‘[ “nothing”]’ + htm);
   
if(is.ns4) {
 
fillHTML.write(text1);
 
fillHTML.close();
 
} else {
 
fillHTML.innerHTML = text1;
 
}
 
if (!(count >= text.length-1)){
 
count+=1;
 
setTimeout(‘writetext()’,1);
 
}
 
else{
 
count=0;
 
text2+=’ <p>’
 
if (count2!=12){
  
count2++
  
text = eval(‘msg[‘+count2+’].split( “”)’);
  
setTimeout(‘writetext()’,5);
 
}
 
}
}
<!– Pyara style baby .. –>
//–>
</SCRIPT>
<META content=”MSHTML 6.00.2800.1476″ name=GENERATOR>
<STYLE type=text/css>#nothing {
 
VISIBILITY: visible
}
</STYLE>
</HEAD>
<BODY text=#00ff00 vLink=#008000 aLink=#008000 link=#008000 bgColor=#000000
background=”” onload=writetext();>
<DIV id=nothing style=”WIDTH: 889px; HEIGHT: 259px”></DIV>
<SCRIPT language=JavaScript>
<!–
if (document.all){
Cols=10;
Cl=48;//Space’s are included so real length is 24!
Cs=120;
Ts=18;
Tc=’#008800′;
Tc1=’#00ff00′;
MnS=20;
MxS=20;
I=Cs;
Sp=new Array();S=new Array();Y=new Array();
C=new Array();M=new Array();B=new Array();
RC=new Array();E=new Array();Tcc=new Array(0,1,2,3,4,5,6,7,8,9);
document.write(“<div id=’Container’ style=’position:absolute;top:0;left:-“+Cs+”‘>”);
document.write(“<div style=’position:relative’>”);
for(i=0; i < Cols; i++){
S[i]=I+=Cs;
document.write(“<div id=’A’ style=’position:absolute;top:0;font-family:Arial;font-size:”
+Ts+”px;left:”+S[i]+”;width:”+Ts+”px;height:0px;color:”+Tc+”;visibility:hidden’></div>”);
}
document.write(“</div></div>”);

for(j=0; j < Cols; j++){
RC[j]=1+Math.round(Math.random()*Cl);
Y[j]=0;
Sp[j]=Math.round(MnS+Math.random()*MxS);
for(i=0; i < RC[j]; i++){
B[i]=”;
C[i]=Math.round(Math.random()*1)+’ ‘;
M[j]=B[0]+=C[i];
}
}
function Cycle(){
Container.style.top=window.document.body.scrollTop;
for (i=0; i < Cols; i++){
var r = Math.floor(Math.random()*Tcc.length);
E[i] = ‘<font color=’+Tc1+’>’+Tcc[r]+'</font>’;
Y[i]+=Sp[i];

if (Y[i] > window.document.body.clientHeight){
for(i2=0; i2 < Cols; i2++){
RC[i2]=1+Math.round(Math.random()*Cl);
for(i3=0; i3 < RC[i2]; i3++){
B[i3]=”;
C[i3]=Math.round(Math.random()*1)+’ ‘;
C[Math.floor(Math.random()*i2)]=’ ‘+’ ‘;
M[i]=B[0]+=C[i3];
Y[i]=-Ts*M[i].length/1.5;
A[i].style.visibility=’visible’;
}
Sp[i]=Math.round(MnS+Math.random()*MxS);
}
}
A[i].style.top=Y[i];
A[i].innerHTML=M[i]+’ ‘+E[i]+’ ‘;
}
setTimeout(‘Cycle()’,100)
}
Cycle();
}
// –>
</SCRIPT>
</BODY></HTML>

发表评论

电子邮件地址不会被公开。 必填项已用*标注

百度XML GoogleXML SiteMap

游侠海外岛 is Stephen Fry proof thanks to caching by WP Super Cache