Erstellen Sie eine neue Textdatei, kopieren Sie den folgenden Code in und ändern Sie den Dateinamen in Clock.html und führen Sie ihn aus.
<Script Language = javaScript> <!- dcol = '0000ff'; // Datum Farbe. fcol = '0000ff'; // Gesichtsfarbe. scol = '0000ff'; // Sekunden Farbe. MCOL = '0000ff'; // Minuten Farbe. hcol = '0000ff'; // Stunden Farbe. ClockHeight = 40; Clockwidth = 40; ClockFrommousey = 0; ClockFrommousex = 100; // nichts unten verändere! Ausrichtungen werden verloren! D = Neuarray ("Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"); M = New Array ("Januar", "Februar", "März", "April", "May", "June", "Juli", "August", "September", "Oktober", "November", "Dezember"); Datum = neues Datum (); Day = Date.GetDate (); Jahr = Datum.Getyear (); if (Jahr <2000) Jahr = Jahr+1900; Touthsdate = ""+d [date.getday ()]+""+tag+""+m [Date.getMonth ()]+"+Jahr; D = heutigesDate.split (''); H = '...'; H = H.split (''); M = '....'; M = m.Split (''); S = '.....'; S = S.Split (''); Gesicht = '1 2 3 4 5 6 7 8 9 10 11 12'; font = 'arial'; Größe = 1; Geschwindigkeit = 0,5; ns = (document.layers); dh = (document.all); Face = face.split (''); n = face.length; a = Größe*10; ymouse = 0; Xmouse = 0; sclll = 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; sclll = 0; Schritt = 0,06; Currstep = 0; y = new Array (); x = new Array (); y = new Array (); x = new Array (); für (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 (); für (i = 0; i <d.length; i ++) {dy [i] = 0; dx [i] = 0; dy [i] = 0; dx [i] = 0} if (ns) {für (i = 0; i <d.Length; i ++) document.write ('<layer name = "+++i+'" " width = '+a+'> <center> '+props2+d [i]+' </font> </center> </layer> '); für (i = 0; i <n; i ++) document.write ('<layer name = "nsface'+i+'" top = 0 links = 0 hohe ='+a+'width ='+a+'> <center>'+Requisiten+Gesicht [i]+'</font> </center> </layer> </layer>); für (i = 0; i <sength; i ++) document.write ('<layer name = nsSeconds'+i+'top = 0 links = 0 width = 15 height = 15> <font face = arial size = 3 color ='+scol+'> <center 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>'); für (i = 0; i <H.Length; i ++) document.write ('<layer name = nshours'+i+'top = 0 links = 0 width = 15 height = 15> <font face = arial size = 3 color ='+hcol+'> <center } if (dh) {document.write ('<div id = "od" style = "Position: absolut; top: 0px; links: 0px"> <div style = "Position: relativ">'); für (i = 0; i <d.length; i ++) document.write ('<div id = "iedate" style = "Position: absolut; top: 0px; links: 0; Höhe:'+a+'; width:'+a+'; document.write ('</div> </div>'); document.write ('<div id = "von" style = "Position: absolut; top: 0px; links: 0px"> <div style = "Position: relativ">'); für (i = 0; i <n; i ++) document.write ('<div id = "ieface" style = "Position: absolut; top: 0px; links: 0; Höhe:'+a+'; width:'+a+'; text-align: center">'+props+face [i]+'</b> </font> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>); document.write ('</div> </div>'); document.write ('</div> </div>'); document.write ('<div id = "oh" style = "Position: absolut; top: 0px; links: 0px"> <div style = "Position: relativ">'); für (i = 0; i <H.Length; i ++) document.write ('<div id = "iEHours" style = "Position: absolut; width: 16px; Höhe: 16px; Schriftfamilie: Arial; Schriftgröße: 16px; Farbe:'+hcol+'; document.write ('</div> </div>'); document.write ('<div id = "om" style = "Position: absolut; top: 0px; links: 0px"> <div style = "Position: relativ">'); für (i = 0; i <m.length; i ++) document.write ('<div id = "ieminutes" style = "Position: absolut; width: 16px; Höhe: 16px; Schriftfamilie: Arial; Schriftgröße: 16px; Farbe:'+mcol+'; document.write ('</div> </div>') document.write ('<div id = "os" style = "Position: absolut; top: 0px; links: 0px"> <div style = "Position: relativ">'); für (i = 0; i <sength; i ++) document.write ('<div id = "ieseconds" style = "Position: absolut; width: 16px; Höhe: 16px; Schriftfamilie: Arial; Schriftgröße: 16px; Farbe:'+Scol+'; document.write ('</div> </div>')} (ns)? window.captureEvents (event.mousemove): 0; Funktion Maus (evnt) {ymouse = (ns)? evnt.pagey+clockFrommousey- (window.pageyOffset): event.y+clockfrommousey; xmouse = (ns)? evnt.pagex+clockFrommousex: event.x+clockFrommousex; } (ns)? Fenster.onmousemove = Maus: document.onmousemove = Maus; function ClockAndAssign () {time = new Date (); sec = time.getSeconds (); sec = -1.57 + math.pi * Sec/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 (dh) {od.style.top = window.document.body.scrolltop; Von.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; } für (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) + sclll; F.left = x [i] + clockwidth*math.cos (-1.0471 + i*split*math.pi/180); } für (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)+sclll; Hl.left = x [i]+Handx+(i*Handbreite)*Math.cos (HRS); } für (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)+sclll; Ml.left = x [i]+Handx+(i*Handbreite)*math.cos (min); } für (i = 0; i <sength; 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*Handbreite)*Math.cos (Sec); } für (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*dslit*math.pi/180)+sclll; Dl.left = dx [i] + clockwidth*1.5*math.cos (currstep + i*dSplit*math.pi/180); } currstep- = Schritt; } function Delay () {sclll = (ns)? Fenster.pageyOffset: 0; Dy [0] = math.round (dy [0]+= (ymouse) -Dy [0])*Geschwindigkeit); Dx [0] = math.round (dx [0]+= ((xmouse) -dx [0])*Geschwindigkeit); für (i = 1; i <d.length; i ++) {dy [i] = math.round (dy [i]+= (dy [i-1] -dy [i])*Geschwindigkeit); Dx [i] = math.round (dx [i]+= (dx [i-1] -dx [i])*Geschwindigkeit); } y [0] = math.round (y [0]+= ((ymouse) -y [0])*Geschwindigkeit); x [0] = math.round (x [0]+= ((xMouse) -x [0])*Geschwindigkeit); für (i = 1; i <n; i ++) {y [i] = math.round (y [i]+= (y [i-1] -y [i])*Geschwindigkeit); x [i] = math.round (x [i]+= (x [i-1] -x [i])*Geschwindigkeit); } ClockandaSign (); setTimeout ('Delay ()', 40); } if (ns || dh) Fenster.onload = delay; // -> </script>