好友
阅读权限10
听众
最后登录1970-1-1
|
实现黑客帝国里面,炫酷字符面,
最近学习前段,然后就尝试些,这是主要是用JavaScript写的,创建java web 工程,然后在jsp页面使用即可。在IE6以上版本可以正常,chrome或者Firefox不能正常运行。纯娱乐为主!这是源码:
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Write By Unicorn</title>
</head>
<style type="text/css">
body
{
overflow:hidden;
margin:0;
background-color:#000000;
font-family:宋体;
}
div .#heike
{
overflow:hidden;
position:relative;
top:25%;
width:100%;
height:100%;
border-style:solid;
border-width:1;
border-color:#009900;
}
</style>
<script language="javascript">
var strCount;
var str;
var Color;
var Font;
var sLine = "W<br>r<br>i<br>t<br>e<br><br>B<br>y<br><br>U<br>n<br>i<br>c<br>o<br>r<br>n<br>";
function OnLoad()
{
strCount = 80;
str =[];
Color = [];
Font = [];
Color[0] = "#002211";
Color[1] = "#003311";
Color[2] = "#005511";
Color[3] = "#008811";
Color[4] = "#00BB11";
Color[5] = "#114411";
Color[6] = "#335566";
Color[7] = "#668899";
Color[8] = "#99BBAA";
Color[9] = "#CECECC";
Font[0] = "20px";
Font[1] = "30px";
Font[2] = "40px";
Font[3] = "50px";
Font[4] = "60px";
setTimeout("strik()",10);
}
function strik()
{
for (var i= 0; i<strCount;i++)
{
if(typeof(str) != "undefined")
{
if(str["Carch"].style.pixelTop > heike.offsetWidth)
{
str["Carch"].outerHTML ="";
delete str["Level"];
delete str["Speed"];
delete str["Carch"];
delete str;
}
else
{
str["Carch"].style.pixelTop +=str["Speed"];
}
}
else if(Math.random()<0.8)
{
str = new Array();
str["Level"] = Math.round(Math.random()*4);
str["Speed"] = (Math.round(Math.random()*str["Level"])<<2)+30;
document.all["heike"].insertAdjacentHTML("AfterBegin","<span id='SPAN_"+i+"'>"+sLine+"</span>");
str["Carch"] = document.all["SPAN_"+i];
str["Carch"].style.fontSize = Font[str["Level"]];
str["Carch"].style.position ="absolute";
str["Carch"].style.pixelLeft = Math.round(Math.random()*heike.clientWidth);
str["Carch"].style.pixelTop = -str["Carch"].offsetHeight;
str["Carch"].style.color = Color[str["Level"]+5];
str["Carch"].style.filter = "glow(Color="+Color[str["Level"]]+",Strength=5)";
str["Carch"].style.zIndex = str["Level"];
}
}
setTimeout("strik()",10);
}
</script>
<body>
<table width ="100%" height="100%" border="0" cellspacing="0" cellpadding="0">
<tr><td align="center" height="100%"><div id="heike"></div></td></tr>
</table>
</body>
</html>
|
-
黑客帝国炫酷界面
免费评分
-
查看全部评分
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|