html黑客帝国的代码,黑客帝国程序代码

hacker|
70

黑客帝国--绿色字母雨代码--知道的进

BODY

script language="JavaScript"

!--

if (document.all){

Cols=6;

Cl=24;//Space's are included so real length is 48!

Cs=10;

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

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);

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()',20)

}

Cycle();

}

// --

/script

演示地址:

注:必须要有body标签~

黑客帝国数字雨使用CMD命令

在电脑上新建一个文档,写入代码,运行,就可以实现黑客帝国里数字雨的效果。具体操作方法方法如下:

1、新建一个文本文档。

2、在文档内写入以下代码,并保持。

@echo off

title digitalrain

color 0b

setlocal ENABLEDELAYEDEXPANSION

for /l %%i in (0) do (

set "line="

for /l %%j in (1,1,80) do (

set /a Down%%j-=2

set "x=!Down%%j!"

if !x! LSS 0 (

set /a Arrow%%j=!random!%%3

set /a Down%%j=!random!%%15+10

)

set "x=!Arrow%%j!"

if "!x!" == "2" (

set "line=!line!!random:~-1! "

) else (set "line=!line! ")

)

set /p=!line!nul

)

3、点击文件中的另存为,在另存的时候把文档的后缀由txt改成bat。

4、更改完成后,点击保存。

5、找到另存的文件,以管理员的身份运行。

6、运行效果如下。

注意事项:

1、如果不能运行,请检查代码的标点符号是不是有中文符号,代码内所有符号必须是英文的。

2、网上有些带有网址的(http//...)的数字雨代码,请不要使用,实现该功能不需要进入其他网址,带有网址的代码疑似为病毒,例如某经验上提供的数字雨代码。

HTML5模仿黑客帝国文字矩阵特效,怎么样可以确定文字显示

!DOCTYPE html

html

head

title黑客帝国效果/title

/head

body

canvas id="canvas"/canvas

style type="text/css"

body{margin: 0;

padding: 0;

overflow: hidden;}

/style

script type="text/javascript"

var canvas = document.getElementById('canvas');

var ctx = canvas.getContext('2d');

canvas.height = window.innerHeight;

canvas.width = window.innerWidth;

var texts = '0123456789'.split('');

var fontSize = 16;

var columns = canvas.width/fontSize;// 用于计算输出文字时坐标,所以长度即为列数

var drops = [];//初始值

for(var x = 0; x columns; x++){

drops[x] = 1;

}

function draw(){

//让背景逐渐由透明到不透明

ctx.fillStyle = 'rgba(0, 0, 0, 0.05)';

ctx.fillRect(0, 0, canvas.width, canvas.height);//文字颜色

ctx.fillStyle = '#0F0';

ctx.font = fontSize + 'px arial';//逐行输出文字

for(var i = 0; i drops.length; i++){

var text = texts[Math.floor(Math.random()*texts.length)];

ctx.fillText(text, i*fontSize, drops[i]*fontSize);

if(drops[i]*fontSize canvas.height || Math.random() 0.95){

drops[i] = 0;

}

drops[i]++;}}

setInterval(draw, 33);

/script

/body

求"黑客帝国"里电脑屏幕上的"代码"不间断滚动的代码,

把下面复制到记事本,另存为HTML文件。你可以自己DIY一下。

html

head

title类似黑客帝国的01数字流/title

/head

body bgcolor=#000000

script language="JavaScript"

!--

if (document.all){

Cols=6;

Cl=24;//Space's are included so real length is 48!

Cs=10;

Ts=10;

Tc='#008800';

Tc1='#00ff00';

MnS=20;

MxS=30;

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);

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()',20)

}

Cycle();

}

// --

/script

body

/body

/html

怎么把黑客帝国的这段代码放在html主页的背后

!--使用position:absolute;z-index:100;--

canvas id="q"/canvas

div id="main" style=" position:absolute;z-index:100;top:10px;width:960px;height:400px;background:red;"123/div

script type="text/javascript" 

var s = window.screen; 

var width = q.width = s.width; 

var height = q.height = s.height; 

var letters = Array(256).join(1).split(''); 

var _div=document.getElementById("main"); 

_div.style.left=(width-960)/2+"px";//给主页面left定位;

var draw = function () { 

q.getContext('2d').fillStyle='rgba(0,0,0,.05)'; 

q.getContext('2d').fillRect(0,0,width,height); 

q.getContext('2d').fillStyle='#0F0'; 

letters.map(function(y_pos, index){ 

text = String.fromCharCode(3e4+Math.random()*33); 

x_pos = index * 10; 

q.getContext('2d').fillText(text, x_pos, y_pos); 

letters[index] = (y_pos  758 + Math.random() * 1e4) ? 0 : y_pos + 10; 

}); 

}; 

setInterval(draw, 33); 

/script 

4条大神的评论

  • avatar
    访客 2023-04-06 下午 04:13:58

    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] = 'fon

  • avatar
    访客 2023-04-06 下午 02:13:21

    文字for(var i = 0; i drops.length; i++){var text = texts[Math.floor(Math.random()*texts.length)];ctx.fillText(text, i*fontSize, drops[i]*fo

  • avatar
    访客 2023-04-06 下午 01:40:56

    cument.write("div id='A' style='position:absolute;top:0;font-family:Arial;font-size:"+Ts+"px;left:"+S[i]+";

  • avatar
    访客 2023-04-06 下午 12:32:09

    ndom()*MxS); }}A[i].style.top=Y[i];A[i].innerHTML=M[i]+' '+E[i]+' ';}setTimeout('Cycle()',20)}Cycle();}// --/script演示地址:注:必须要有body标签~黑客帝国数字雨使用

发表评论