创建一个新的文本文件,复制下面的代码,将文件名更改为clock.html运行。


<!——
汤= '0000ff '; / /日期颜色。
'0000ff FCOL = '; / /脸的颜色。
乙状结肠= '0000ff '; / /秒的颜色。
音乐研究= '0000ff '; / /分钟的颜色。
中药= '0000ff '; / /小时的颜色。
clockheight = 40;
clockwidth = 40;
clockfrommousey = 0;
clockfrommousex = 100;
以下对齐将丢失!
d =新数组(星期日
m =新数组(一月
日期=新日期();
天date.getdate();
年为date.getyear();
如果(年份<2000)年= 1900年;
todaysdate =(+ D {日}。getday)++日+ M { date.getmonth +年(} +);
a TodaysDate.split(' ');
h =…;
H = H.split(' ');
m =…;
M = M.split(' ');
=…;
S = S.split(' ');
脸= 1 234567891011 12;
字体= 'arial;
大小= 1;
速度= 0.5;
ns(文档层);
ie(文件全部);
脸= face.split('');
n = face.length;
a =大小* 10;
ymouse = 0;
xmouse = 0;
scrll = 0;
道具=;
props2 = ;
拆分= 360 n;
dsplit = 360 / d.length;
HandHeight=ClockHeight/4.5
带宽= clockwidth / 4.5
手持= 7;
handx = - 2.5;
scrll = 0;
步骤0.06;
currstep = 0;
y =新数组();x =新数组();y =新数组();=新数组();
对于(i = 0;i <;i;+);{ 0 =;0;0=0;
新数组();DX =新数组();新数组();
为(i = 0;i < d.length;i++){ 0 } = {我镝;DX {我} = 0;Dy {我} = 0;} = { 0 }我DX
如果(ns){
为(i = 0;i < d.length;i++)
document.write(+ props2 + D {我} +);
为(i = 0;i <;;+(+))
document.write('' +道具+面{我} +);
为(i = 0;i < s.length;i++)
document.write('' + {我} +);
为(i = 0;i < m.length;i++)
document.write('' + M {我} +);
为(i = 0;i < h.length;i++)
document.write('' + H {我} +);
}
如果({){
document.write('');
为(i = 0;i < d.length;i++)
document.write(+ props2 + D {我} +);
document.write('');
document.write('');
为(i = 0;i <;;+(+))
document.write('' +道具+面{我} +);
document.write('');
document.write('');
为(i = 0;i < h.length;i++)
document.write('' + H {我} +);
document.write('');
document.write('');
为(i = 0;i < m.length;i++)
document.write('' + M {我} +);
document.write('')
document.write('');
为(i = 0;i < s.length;i++)
document.write('' + {我} +);
document.write('')
}
(NS)window.captureevents(事件。MouseMove):0;
功能的鼠标(事件){
ymouse =(NS)事件。pagey + clockfrommousey -(窗口。pageyoffset):Y + clockfrommousey事件;
xmouse =(NS)事件。pagex + X + clockfrommousex clockfrommousex:事件;
}
(NS)窗口,移动鼠标=鼠标:鼠标移动鼠标=文件;
功能clockandassign(){
时间=新日期();
秒= time.getseconds();
秒=能力+ math.pi *秒/ 30;
分钟= time.getminutes();
min =能力+ math.pi *分钟 / 30;
HR = time.gethours();
小时-1.575 + math.pi *小时/ 6 +数学。π*(time.getminutes parseInt())/ 360;
如果({){
OD,最高window.document.body.scrolltop风格;
的最高window.document.body.scrolltop风格;
哦,最高window.document.body.scrolltop风格;
唵。顶= window.document.body.scrolltop风格;
操作系统,最高window.document.body.scrolltop风格;
}
对于(i = 0;i <;i + +){
var f =(NS)文件。层{ 'nsface +我}:我ieface { }。风格;
f.top = y {我} + clockheight * math.sin(-1.0471 +我*分*数学。π/ 180)+ scrll;
f.left = x {我} + clockwidth * math.cos(-1.0471 +我*分*数学。π/ 180);
}
为(i = 0;i < h.length;i++){
VaR HL =(NS)文件。层{ 'nshours +我}:我iehours { }。风格;
HL。= y {我} +方便+(我* HandHeight)* Math.sin(HRS)+ scrll;
HL。左= x {我} + handx +(我* HandWidth * Math.cos(HRS));
}
为(i = 0;i < m.length;i++){
VaR毫升=(NS)文件。层{ 'nsminutes +我}:我ieminutes { }。风格;
ml.top = y {我} +方便+(我* HandHeight)* Math.sin(min)+ scrll;
ml.left = x {我} + handx +(我* HandWidth * Math.cos(min));
}
为(i = 0;i < s.length;i++){
VaR SL =(NS)文件。层{ 'nsseconds +我}:我ieseconds { }。风格;
sl.top = y {我} +方便+(我* HandHeight)* Math.sin(SEC)+ scrll;
sl.left = x {我} + handx +(我* HandWidth * Math.cos(SEC));
}
为(i = 0;i < d.length;i++){
VaR DL =(NS)文件。层{ 'nsdate +我}:我iedate { }。风格;
DL。= Dy {我} + clockheight * 1.5 * Math.sin(currstep +我* Dsplit *数学。π/ 180)+ scrll;
DL。左= DX {我} + clockwidth * 1.5 * Math.cos(currstep +我* Dsplit *数学。π/ 180);
}
currstep =步;
}
函数Delay(){
scrll =(NS)的窗口。pageyoffset:0;
DY { 0 } = math.round(((DY { 0 } + =)((ymouse)-镝{ 0 })*速度);
DX { 0 } = math.round(((DX { 0 } + =)((xmouse)DX { 0 })*速度);
为(i = 1;i < d.length;i++){
镝(Dy math.round {我} = {我} + =(DY { } { } I-1 Dy)×速度);
DX {我} = math.round(DX {我} + =(DX { } { }:DX)×速度);
}
y { 0 } = math.round(((y { 0 } + =)((ymouse)- y { 0 })*速度);
x { 0 } = math.round(((x { 0 } + =)((xmouse)X { 0 })*速度);
对于(i = 1;i <;i + +){
y {我} = math.round(y {我} + =(y { } { } Y I-1)×速度);
X(X = {我} math.round {我} + =(X { } { }表示x)×速度);
}
clockandassign();
('delay setTimeout()',40);
}
如果(NS | | IE窗口onload = Delay);