사용하는 방법
1.먼저 clock.js파일을 서버에 올려준다.
2.페지에
삽입하시면 됩니다 아래는 clock.js 안의 소스입니다
/***********************************************/
dCol='green';//date colour.
fCol='blue';//face colour.
sCol='red';//seconds colour.
mCol='red';//minutes colour.
hCol='red';//hours colour.
ClockHeight=40;
ClockWidth=40;
ClockFromMouseY=0;
ClockFromMouseX=100;
//Alter nothing below! Alignments will be lost!
d=new Array("일요일","월요일","화요일","수요일","목요일","금요일","토요일");
m=new Array("1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월");
date=new Date();
day=date.getDate();
year=date.getYear();
if (year < 2000) year=year+1900;
TodaysDate=" "+year+"년"+" "+m[date.getMonth()]+" "+day+"일"+" "+d[date.getDay()] ;
D=TodaysDate.split('');
H='...';
H=H.split('');
M='....';
M=M.split('');
S='.....';
S=S.split('');
Face='1 2 3 4 5 6 7 8 9 10 11 12';
font='Arial';
size=2.5;
speed=0.6;
ns=(document.layers);
ie=(document.all);
Face=Face.split(' ');
n=Face.length;
a=size*10;
ymouse=0;
xmouse=0;
scrll=0;
props="<font face="+font+" size="+size+" color="+fCol+"><B>";
props2="<font face="+font+" size="+size+" color="+dCol+"><B>";
Split=360/n;
Dsplit=360/D.length;
HandHeight=ClockHeight/4.5
HandWidth=ClockWidth/4.5
HandY=-7;
HandX=-2.5;
scrll=0;
step=0.06;
currStep=0;
y=new Array();x=new Array();Y=new Array();X=new Array();
for (i=0; i < n; i++){y[i]=0;x[i]=0;Y[i]=0;X[i]=0}
Dy=new Array();Dx=new Array();DY=new Array();DX=new Array();
for (i=0; i < D.length; i++){Dy[i]=0;Dx[i]=0;DY[i]=0;DX[i]=0}
if (ns){
for (i=0; i < D.length; i++)
document.write('<layer name="nsDate'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props2+D[i]+'</font></center></layer>');
for (i=0; i < n; i++)
document.write('<layer name="nsFace'+i+'" top=0 left=0 height='+a+' width='+a+'><center>'+props+Face[i]+'</font></center></layer>');
for (i=0; i < S.length; i++)
document.write('<layer name=nsSeconds'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+sCol+'><center><b>'+S[i]+'</b></center></font></layer>');
for (i=0; i < M.length; i++)
document.write('<layer name=nsMinutes'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+mCol+'><center><b>'+M[i]+'</b></center></font></layer>');
for (i=0; i < H.length; i++)
document.write('<layer name=nsHours'+i+' top=0 left=0 width=15 height=15><font face=Arial size=3 color='+hCol+'><center><b>'+H[i]+'</b></center></font></layer>');
}
if (ie){
document.write('<div id="Od" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < D.length; i++)
document.write('<div id="ieDate" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props2+D[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Of" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < n; i++)
document.write('<div id="ieFace" style="position:absolute;top:0px;left:0;height:'+a+';width:'+a+';text-align:center">'+props+Face[i]+'</B></font></div>');
document.write('</div></div>');
document.write('<div id="Oh" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < H.length; i++)
document.write('<div id="ieHours" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+hCol+';text-align:center;font-weight:bold">'+H[i]+'</div>');
document.write('</div></div>');
document.write('<div id="Om" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < M.length; i++)
document.write('<div id="ieMinutes" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+mCol+';text-align:center;font-weight:bold">'+M[i]+'</div>');
document.write('</div></div>')
document.write('<div id="Os" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i=0; i < S.length; i++)
document.write('<div id="ieSeconds" style="position:absolute;width:16px;height:16px;font-family:Arial;font-size:16px;color:'+sCol+';text-align:center;font-weight:bold">'+S[i]+'</div>');
document.write('</div></div>')
}
(ns)?window.captureEvents(Event.MOUSEMOVE):0;
function Mouse(evnt){
ymouse = (ns)?evnt.pageY+ClockFromMouseY-(window.pageYOffset):event.y+ClockFromMouseY;
xmouse = (ns)?evnt.pageX+ClockFromMouseX:event.x+ClockFromMouseX;
}
(ns)?window.onMouseMove=Mouse:document.onmousemove=Mouse;
function ClockAndAssign(){
time = new Date ();
secs = time.getSeconds();
sec = -1.57 + Math.PI * secs/30;
mins = time.getMinutes();
min = -1.57 + Math.PI * mins/30;
hr = time.getHours();
hrs = -1.575 + Math.PI * hr/6+Math.PI*parseInt(time.getMinutes())/360;
if (ie){
Od.style.top=window.document.body.scrollTop;
Of.style.top=window.document.body.scrollTop;
Oh.style.top=window.document.body.scrollTop;
Om.style.top=window.document.body.scrollTop;
Os.style.top=window.document.body.scrollTop;
}
for (i=0; i < n; i++){
var F=(ns)?document.layers['nsFace'+i]:ieFace[i].style;
F.top=y[i] + ClockHeight*Math.sin(-1.0471 + i*Split*Math.PI/180)+scrll;
F.left=x[i] + ClockWidth*Math.cos(-1.0471 + i*Split*Math.PI/180);
}
for (i=0; i < H.length; i++){
var HL=(ns)?document.layers['nsHours'+i]:ieHours[i].style;
HL.top=y[i]+HandY+(i*HandHeight)*Math.sin(hrs)+scrll;
HL.left=x[i]+HandX+(i*HandWidth)*Math.cos(hrs);
}
for (i=0; i < M.length; i++){
var ML=(ns)?document.layers['nsMinutes'+i]:ieMinutes[i].style;
ML.top=y[i]+HandY+(i*HandHeight)*Math.sin(min)+scrll;
ML.left=x[i]+HandX+(i*HandWidth)*Math.cos(min);
}
for (i=0; i < S.length; i++){
var SL=(ns)?document.layers['nsSeconds'+i]:ieSeconds[i].style;
SL.top=y[i]+HandY+(i*HandHeight)*Math.sin(sec)+scrll;
SL.left=x[i]+HandX+(i*HandWidth)*Math.cos(sec);
}
for (i=0; i < D.length; i++){
var DL=(ns)?document.layers['nsDate'+i]:ieDate[i].style;
DL.top=Dy[i] + ClockHeight*1.5*Math.sin(currStep+i*Dsplit*Math.PI/180)+scrll;
DL.left=Dx[i] + ClockWidth*1.5*Math.cos(currStep+i*Dsplit*Math.PI/180);
}
currStep-=step;
}
function Delay(){
scrll=(ns)?window.pageYOffset:0;
Dy[0]=Math.round(DY[0]+=((ymouse)-DY[0])*speed);
Dx[0]=Math.round(DX[0]+=((xmouse)-DX[0])*speed);
for (i=1; i < D.length; i++){
Dy[i]=Math.round(DY[i]+=(Dy[i-1]-DY[i])*speed);
Dx[i]=Math.round(DX[i]+=(Dx[i-1]-DX[i])*speed);
}
y[0]=Math.round(Y[0]+=((ymouse)-Y[0])*speed);
x[0]=Math.round(X[0]+=((xmouse)-X[0])*speed);
for (i=1; i < n; i++){
y[i]=Math.round(Y[i]+=(y[i-1]-Y[i])*speed);
x[i]=Math.round(X[i]+=(x[i-1]-X[i])*speed);
}
ClockAndAssign();
setTimeout('Delay()',20);
}
if (ns||ie)window.onload=Delay;
/****** 시계를 보시려면 http://bulsacho.net 에 들어가시면 볼수잇습니다.**/
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 1730 | 17년 전 | 1179 | ||
| 1729 | 17년 전 | 1608 | ||
| 1728 | 17년 전 | 1675 | ||
| 1727 | 17년 전 | 1814 | ||
| 1726 | 17년 전 | 2951 | ||
| 1725 | 17년 전 | 2089 | ||
| 1724 |
|
17년 전 | 1768 | |
| 1723 |
끝없는사랑
|
17년 전 | 2108 | |
| 1722 |
끝없는사랑
|
17년 전 | 1815 | |
| 1721 | 17년 전 | 3345 | ||
| 1720 | 17년 전 | 1529 | ||
| 1719 | 17년 전 | 1646 | ||
| 1718 |
사랑합니다
|
17년 전 | 1364 | |
| 1717 | 17년 전 | 2185 | ||
| 1716 | 17년 전 | 3138 | ||
| 1715 |
|
17년 전 | 2271 | |
| 1714 |
|
17년 전 | 1730 | |
| 1713 | 17년 전 | 2986 | ||
| 1712 | 17년 전 | 4422 | ||
| 1711 | 17년 전 | 1735 | ||
| 1710 | 17년 전 | 3238 | ||
| 1709 |
jeans
|
17년 전 | 1566 | |
| 1708 |
|
17년 전 | 3474 | |
| 1707 | 17년 전 | 5839 | ||
| 1706 |
|
17년 전 | 1419 | |
| 1705 |
|
17년 전 | 2156 | |
| 1704 | 17년 전 | 1788 | ||
| 1703 |
심심맨닷컴
|
17년 전 | 1546 | |
| 1702 | 17년 전 | 2419 | ||
| 1701 |
|
17년 전 | 2622 | |
| 1700 | 17년 전 | 1599 | ||
| 1699 | 17년 전 | 2682 | ||
| 1698 |
RedRiverFisher
|
17년 전 | 3167 | |
| 1697 |
심심맨닷컴
|
17년 전 | 1527 | |
| 1696 |
eclub
|
17년 전 | 1937 | |
| 1695 | 17년 전 | 3841 | ||
| 1694 |
깜장고무신
|
17년 전 | 4474 | |
| 1693 |
stuartkim
|
17년 전 | 1879 | |
| 1692 |
stuartkim
|
17년 전 | 1743 | |
| 1691 |
|
17년 전 | 2668 | |
| 1690 | 17년 전 | 1843 | ||
| 1689 | 17년 전 | 3931 | ||
| 1688 | 17년 전 | 1653 | ||
| 1687 | 16년 전 | 1925 | ||
| 1686 |
|
17년 전 | 2254 | |
| 1685 | 17년 전 | 2103 | ||
| 1684 |
|
17년 전 | 3568 | |
| 1683 |
leeLook
|
17년 전 | 1588 | |
| 1682 | 17년 전 | 2653 | ||
| 1681 | 17년 전 | 1641 | ||
| 1680 | 17년 전 | 1902 | ||
| 1679 | 17년 전 | 7418 | ||
| 1678 | 17년 전 | 1994 | ||
| 1677 | 17년 전 | 4090 | ||
| 1676 | 17년 전 | 2415 | ||
| 1675 | 17년 전 | 2424 | ||
| 1674 | 17년 전 | 2149 | ||
| 1673 | 17년 전 | 2197 | ||
| 1672 | 17년 전 | 2622 | ||
| 1671 | 17년 전 | 3215 | ||
| 1670 | 17년 전 | 5324 | ||
| 1669 |
플래시007
|
17년 전 | 2781 | |
| 1668 |
|
17년 전 | 2696 | |
| 1667 | 17년 전 | 2549 | ||
| 1666 |
|
17년 전 | 1795 | |
| 1665 | 17년 전 | 2204 | ||
| 1664 | 17년 전 | 5306 | ||
| 1663 |
|
17년 전 | 3019 | |
| 1662 |
|
17년 전 | 2579 | |
| 1661 |
|
17년 전 | 3255 | |
| 1660 |
|
17년 전 | 2468 | |
| 1659 |
|
17년 전 | 2828 | |
| 1658 | 17년 전 | 5873 | ||
| 1657 | 17년 전 | 2631 | ||
| 1656 |
Piece
|
17년 전 | 2018 | |
| 1655 |
|
17년 전 | 2651 | |
| 1654 | 17년 전 | 1474 | ||
| 1653 | 17년 전 | 9797 | ||
| 1652 | 17년 전 | 4455 | ||
| 1651 | 17년 전 | 3285 | ||
| 1650 | 17년 전 | 1811 | ||
| 1649 | 17년 전 | 3600 | ||
| 1648 | 17년 전 | 2284 | ||
| 1647 | 17년 전 | 3731 | ||
| 1646 | 17년 전 | 5183 | ||
| 1645 | 17년 전 | 3846 | ||
| 1644 | 17년 전 | 2695 | ||
| 1643 | 17년 전 | 2940 | ||
| 1642 | 17년 전 | 2448 | ||
| 1641 | 17년 전 | 2786 | ||
| 1640 |
porgy
|
17년 전 | 1899 | |
| 1639 | 18년 전 | 3443 | ||
| 1638 |
컴퓨터기술자
|
18년 전 | 2134 | |
| 1637 |
|
18년 전 | 2258 | |
| 1636 | 18년 전 | 2072 | ||
| 1635 | 18년 전 | 3047 | ||
| 1634 |
귀여운현호
|
18년 전 | 1995 | |
| 1633 |
태양의서쪽
|
18년 전 | 2669 | |
| 1632 | 18년 전 | 3869 | ||
| 1631 | 18년 전 | 4566 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기