What's the time?

This is a discussion on "What's the time?" within the JavaScript Forum section. This forum, and the thread "What's the time? are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Closed Thread
 
LinkBack Thread Tools
  #1 (permalink)  
Old Sep 4th, 2003, 22:05
Rob's Avatar
Rob Rob is offline
Head Admin & CEO

SuperMember
Join Date: Jul 2003
Location: at my desk
Age: 34
Posts: 2,951
Blog Entries: 7
Thanks: 7
Thanked 3 Times in 3 Posts
Send a message via MSN to Rob Send a message via Skype™ to Rob
What's the time?

Just for kicks!!!

<script language="JavaScript">CoLoUrS=new Array('000000','000000','000000'); sCol='0000bb'; mCol='bb0000'; hCol='00bb00'; H='Hours..'; H=H.split(''); H=H.reverse(); M='Minutes..'; M=M.split(''); M=M.reverse(); S='Seconds..'; S=S.split(''); S=S.reverse(); dots=12; var Ypos=0,Xpos=0,Ybase=0,Xbase=0; var ay=0,ax=0,Ay=0,Ax=0,by=0,bx=0,By=0,Bx=0,cy=0,cx=0, Cy=0,Cx=0,dy=0,dx=0,Dy=0,Dx=0; count=0; count_a=0; move=1; ns=(document.layers)?1:0; viz=(document.layers)?'hide':'hidden'; if (ns){ for (i=0; i < dots; i++) { document.write('<layer name=nface'+i+' top=0 left=0 bgcolor=#ffffff clip="0,0,3,3"></layer>'); } for (i=0; i < S.length; i++) { document.write('<layer name=nx'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+sCol+'><center>'+S[i]+'</center></font></layer>'); } for (i=0; i < M.length; i++) { document.write('<layer name=ny'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+mCol+'><center>'+M[i]+'</center></font></layer>'); } for (i=0; i < H.length; i++) { document.write('<layer name=nz'+i+' top=0 left=0 width=36 height=36><font face=Verdana size=2 color='+hCol+'><center>'+H[i]+'</center></font></layer>'); } } else{ document.write('<div id="W" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < dots; i++){ document.write('<div id="face" style="position:absolute;top:0px;left:0px;width:3p x;height:3px;font-size:3px;background:#ffffff"></div>'); } document.write('</div></div>'); document.write('<div id="X" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < S.length; i++){ document.write('<div id="x" style="position:absolute;width:36px;height:36px;fo nt-family:Verdana;font-size:12px;color:'+sCol+';text-align:center;padding-top:10px">'+S[i]+'</div>'); } document.write('</div></div>'); document.write('<div id="Y" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < M.length; i++){ document.write('<div id="y" style="position:absolute;width:36px;height:36px;fo nt-family:Verdana;font-size:12px;color:'+mCol+';text-align:center;padding-top:10px">'+M[i]+'</div>'); } document.write('</div></div>'); document.write('<div id="Z" style="position:absolute;top:0px;left:0px"><div style="position:relative">'); for (i=0; i < H.length; i++){ document.write('<div id="z" style="position:absolute;width:36px;height:36px;fo nt-family:Verdana;font-size:12px;color:'+hCol+';text-align:center;padding-top:10px">'+H[i]+'</div>'); } document.write('</div></div>'); } if (ns){ window.captureEvents(Event.MOUSEMOVE); function nsMouse(evnt){ Ypos = evnt.pageY+100; Xpos = evnt.pageX+100; } window.onMouseMove = nsMouse; } else{ function ieMouse(){ Ypos=event.y+100; Xpos=event.x+100; } document.onmousemove=ieMouse; } function clock(){ 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; Ybase=15; Xbase=15; if (ns){ document.layers["nx"+0].visibility=viz; document.layers["ny"+0].visibility=viz; document.layers["nz"+0].visibility=viz; for (i=0; i < S.length; i++){ document.layers["nx"+i].top=ay-12+(i*Ybase)*Math.sin(sec); document.layers["nx"+i].left=ax-12+(i*Xbase)*Math.cos(sec); } for (i=0; i < M.length; i++){ document.layers["ny"+i].top=by-12+(i*Ybase)*Math.sin(min); document.layers["ny"+i].left=bx-12+(i*Xbase)*Math.cos(min); } for (i=0; i < H.length; i++){ document.layers["nz"+i].top=cy-12+(i*Ybase)*Math.sin(hrs); document.layers["nz"+i].left=cx-12+(i*Xbase)*Math.cos(hrs); } for (i=0; i < dots; ++i){ document.layers["nface"+i].top=dy-2+(70*Math.sin(-0.49+dots+i/1.9)); document.layers["nface"+i].left=dx+4+(70*Math.cos(-0.49+dots+i/1.9)); } } else { var scrll=document.body.scrollTop; W.style.pixelTop=scrll; X.style.pixelTop=scrll; Y.style.pixelTop=scrll; Z.style.pixelTop=scrll; x[0].style.visibility=viz; y[0].style.visibility=viz; z[0].style.visibility=viz; for (i=0; i < S.length; i++){ x[i].style.pixelTop=ay-12+(i*Ybase)*Math.sin(sec); x[i].style.pixelLeft=ax-12+(i*Xbase)*Math.cos(sec); } for (i=0; i < M.length; i++){ y[i].style.pixelTop=by-12+(i*Ybase)*Math.sin(min); y[i].style.pixelLeft=bx-12+(i*Xbase)*Math.cos(min); } for (i=0; i < H.length; i++){ z[i].style.pixelTop=cy-12+(i*Ybase)*Math.sin(hrs); z[i].style.pixelLeft=cx-12+(i*Xbase)*Math.cos(hrs); } for (i=0; i < dots; ++i){ face[i].style.pixelTop=dy+6+(70*Math.sin(-0.49+dots+i/1.9)); face[i].style.pixelLeft=dx+4+(70*Math.cos(-0.49+dots+i/1.9)); } } } function MouseFollow(){ ay=Math.round(Ay+=((Ypos)-Ay)*4/15); ax=Math.round(Ax+=((Xpos)-Ax)*4/15); by = Math.round(By+=(ay-By)*4/15); bx = Math.round(Bx+=(ax-Bx)*4/15); cy = Math.round(Cy+=(by-Cy)*4/15); cx = Math.round(Cx+=(bx-Cx)*4/15); dy = Math.round(Dy+=(cy-Dy)*4/15); dx = Math.round(Dx+=(cx-Dx)*4/15); clock(); setTimeout('MouseFollow()',10); } function colourStep(){ count+=move; if (count >= dots) {count=0;count_a+=move} if (count_a == CoLoUrS.length) count_a=0; if (ns) { document.layers["nface"+count].bgColor=CoLoUrS[count_a]; } else { face[count].style.background=CoLoUrS[count_a]; } setTimeout('colourStep()',100); } function StartAll(){ MouseFollow(); colourStep(); } if (document.layers || document.all) window.onload=StartAll;</script>
__________________
Rob - SEO Specialist
Owner & Founder of Webforumz.com

I am currently unavailable for private work

  #2 (permalink)  
Old Sep 6th, 2003, 06:29
Anonymous User
Guest
Posts: n/a
Wow...that is ANNOYING!!!! Keep it and <font color="red">die!</font id="red"> [xx(]
  #3 (permalink)  
Old Sep 25th, 2003, 18:01
Junior Member
Join Date: Sep 2003
Location: United Kingdom
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Cool! But very annoying?
Closed Thread

Tags
time

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
My first time jabo Introduce Yourself 3 Feb 26th, 2008 17:33
It's about time... prizm Introduce Yourself 9 Nov 1st, 2007 12:46
sorry, need more help with time saltedm8 PHP Forum 12 Oct 6th, 2007 21:04
Ok you get this all the time... Docherty Web Page Design 6 Nov 19th, 2005 14:55
Adjusting time from server time to local time Tim356 Classic ASP 10 Jun 21st, 2004 14:57


All times are GMT. The time now is 10:11.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43