首页 > 开发 > CSS > 正文

CSS滤镜效果之雷达屏幕

2020-03-24 18:27:57
字体:
来源:转载
供稿:网友
下面这个程序是用light滤镜模拟雷达屏幕,并且有一架飞机被发现。当然编这个程序要对script 比较熟悉,还要知道lighy滤镜的属性和方法 !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
HTML HEAD TITLE css demo /TITLE
META content="text/html; charset=gb2312" http-equiv=Content-Type
STYLE DIV {
FILTER: blur(add=ture,direction=135,strength=10); WIDTH: 800px
}
/STYLE
SCRIPT
var light_x=20
var light_y=20
var light_z=40
var xinc=10;
var yinc=10;
var r=100;
var deg=0;
var deg1;
var rad;
var pointangle;
var planelight_x=20
var planelight_y=120
var planelight_z=3
var conversion=(2*3.14159)/360
function movefilt()
{
light_x=r+r*Math.cos(deg*conversion);
light_y=r+r*Math.sin(deg*conversion);
deg+=10;
if(deg==360)
deg=0;
body1.filters[0].movelight(0,light_x,light_y,light_z,1);
pointangle=Math.atan((planelight_y-r)/(planelight_x-r))/conversion;
if((planelight_x r) (planelight_y r))
pointangle+=180;
if((planelight_x r) (planelight_y r))
pointangle+=360;
if((planelight_x r) (planelight_y r))
pointangle+=180;
if((deg-10 =pointangle) (pointangle =deg))
body1.filters[0].movelight(2,planelight_x,planelight_y,planelight_z,1);
mytimeout=setTimeout('movefilt()',100);
}
function moveplanes()
{
planelight_x++;
planelight_y++;
if(planelight_y 200) planelight_y=0;
if(planelight_x 200) planelight_x=0;
timeout2=setTimeout('moveplanes()',500);
}
function go(){
body1.filters.light.addcone(100,100,0,light_x,light_y,0,225,0,150,10);
body1.filters.light.addambient(0,225,0,20)
body1.filters.light.addpoint(planelight_x,planelight_y,3,0,225,0,100);
var x=0;
movefilt();
moveplanes();
}
function zap()
{
if(myimg.filters.glow.enabled==1)
{myimg.filters.glow.enabled=0;
}
if (myimg.filters.blendTrans.status==0)
{
myimg.filters.blendTrans.apply();
myimg.filters.glow.enabled=1;
myimg.filters.blendTrans.play();
}
}
/SCRIPT
META content="MSHTML 5.00.2614.3500" name=GENERATOR /HEAD
BODY onload=go()
TABLE border=0 width="89%"
TBODY
TR
TD IMG
src="http://www.jzxue.com/System/uploads/userup/1105/010925541623.jpg" name="body1"
width=200 height=200 hspace=300 id=body1 /TD
/TR
/TBODY
/TABLE
P /P
/BODY /HTMLhtml教程

郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表