Cree un nuevo archivo de texto, copie el siguiente código y cambie el nombre del archivo a clock.html y ejecútelo.
<Script language = javaScript> <!- dcol = '0000ff'; // Color de fecha. fcol = '0000ff'; // Color de la cara. scol = '0000ff'; // segundos color. mcol = '0000ff'; // Minutes color. hcol = '0000ff'; // Color de horas. RelojHeight = 40; Reloj de reloj = 40; ClockFromMousey = 0; ClockFromMousEx = 100; // ¡alterar nada a continuación! ¡Se perderán alineaciones! d = nueva matriz ("domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"); M = nueva matriz ("enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"); fecha = nueva fecha (); day = date.getDate (); año = date.getyear (); if (año <2000) año = año+1900; TodaySdate = ""+D [date.getday ()]+""+día+""+m [date.getMonth ()]+""+año; D = Todaysdate.split (''); H = '...'; H = H.Split (''); M = '....'; M = M.Split (''); S = '.....'; S = S.Split (''); Cara = '1 2 3 4 5 6 7 8 9 10 11 12'; fuente = 'Arial'; tamaño = 1; velocidad = 0.5; ns = (document.layers); es decir = (document.all); Cara = face.split (''); n = face.length; a = tamaño*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>"; División = 360/n; Dsplit = 360/d.length; Handheight = clockHeight/4.5 Handwidth = ClockWidth/4.5 Handy = -7; Handx = -2.5; scrll = 0; paso = 0.06; currstep = 0; y = new Array (); x = new Array (); y = new Array (); x = new Array (); para (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 (); para (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.lengo width = '+a+'> <center> '+props2+d [i]+' </font> </center> </apla> '); para (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> </apete>'); para (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> '); para (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> </apla> '); para (i = 0; i <h.length; i ++) document.write ('<layer name = nshours'+i+'top = 0 izquierd = 0 width = 15 height = 15> <font face = arial size = 3 color =' '+hcol+'> <center> <b> '+h [i]+' <b> </center> </font> </sape> '); } if (es decir) {document.write ('<div id = "od" style = "posición: absoluto; top: 0px; izquierda: 0px"> <Div style = "posición: relativo">'); para (i = 0; i <d.length; i ++) document.write ('<div id = "iedate" style = "posición: absoluto; top: 0px; izquierda: 0; altura:'+a+'; width:'+a+'; text-align: centro">'+props2+d [i]+'<b> </font> </div>'); document.write ('</div> </div>'); document.write ('<div id = "de" style = "posición: absoluto; top: 0px; izquierda: 0px"> <div style = "posición: relativo">'); para (i = 0; i <n; i ++) document.write ('<div id = "ieface" style = "posición: absoluto; top: 0px; izquierda: 0; altura:'+a+'; width:'+a+'; text-align: center">'+stits+face [i]+'<b> </font> </iv>'); document.write ('</div> </div>'); document.write ('</div> </div>'); document.write ('<div id = "oh" style = "posición: absoluto; top: 0px; izquierda: 0px"> <div style = "posición: relativo">'); para (i = 0; i <h.length; i ++) document.write ('<div id = "iehours" style = "posición: absoluto; ancho: 16px; altura: 16px; font-family: arial; font-size: 16px; color:'+hcol+'; texto-text: center; font-weight: negrita: negrita">'+h [i] </'/' <) </'<); document.write ('</div> </div>'); document.write ('<div id = "om" style = "posición: absoluto; top: 0px; izquierda: 0px"> <div style = "posición: relativo">'); para (i = 0; i <m.length; i ++) document.write ('<div id = "ieminutes" style = "posición: absoluto; ancho: 16px; altura: 16px; font-family: arial; font-size: 16px; color:'+mcol+'; text-align: centro; font-weight: negrita">'+m [i]+'<<Div divir document.write ('</div> </div>') document.write ('<div id = "os" style = "posición: absoluto; top: 0px; izquierda: 0px"> <div style = "posición: relativo">'); para (i = 0; i <s.length; i ++) document.write ('<div id = "ieSeconds" style = "Posición: Absolute; ancho: 16px; altura: 16px; font-family: arial; font-size: 16px; color:'+scol+'; text-align: centro; font-weight: negrita: negrita">'+s [i]+'</' </diviv 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 (); 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 (es decir) {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; } para (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*dividido*Math.pi/180) + scrll; F.left = x [i] + clockwidth*math.cos (-1.0471 + i*dividido*math.pi/180); } para (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); } para (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); } para (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); } para (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; } función de retraso () {scrll = (ns)? window.pageyOffset: 0; Dy [0] = Math.round (dy [0]+= ((yMouse) -Dy [0])*Velocidad); Dx [0] = math.round (dx [0]+= ((xmouse) -dx [0])*velocidad); para (i = 1; i <d.length; i ++) {dy [i] = math.round (dy [i]+= (dy [i-1] -dy [i])*velocidad); Dx [i] = math.round (dx [i]+= (dx [i-1] -dx [i])*velocidad); } y [0] = Math.round (y [0]+= ((yMouse) -y [0])*Velocidad); x [0] = Math.round (x [0]+= ((xmouse) -x [0])*Velocidad); para (i = 1; i <n; i ++) {y [i] = math.round (y [i]+= (y [i-1] -y [i])*velocidad); x [i] = math.round (x [i]+= (x [i-1] -x [i])*velocidad); } ClockAnderSign (); setTimeOut ('demandado ()', 40); } if (ns || es decir) window.onload = retraso; // -> </script>