-
Notifications
You must be signed in to change notification settings - Fork 0
/
pantallaTeclado.html
2 lines (2 loc) · 1.94 KB
/
pantallaTeclado.html
1
2
<html><head><script languaje="JavaScript">'use strict';var raf=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||window.msRequestAnimationFrame;var ce,be,bt,pc,pn,lpn,dt,cl;pc=false;pn=1;lpn=1;function ac(a){return parseInt(a/60);}function ad(a){return parseInt(a%60);}window.onload=function(){dt=parseInt(location.hash.replace("#",""))|600;cl=[dt,dt,dt,dt,dt,dt,dt,dt,dt];ce=document.getElementById("cl");be=document.getElementById("bi");window.onresize=sce;sce();addEventListener("keydown", function(e){var k=e.keyCode;if(k>48&&k<58){scp(k-48);}if(k==13||k==32){if(pc){pc=false;}else{pcl();}}if(k==67){ct();}});};function sce(){var a=window.innerHeight;ce.style.fontSize=0.4*a;ce.style.top=0.27*a;}function ccd(){if(lpn!= pn||!pc){pc=false;return;}cl[pn]-=((new Date())-bt)/1000;bt = new Date();var m,s;m=ac(cl[pn]);s=ad(cl[pn]);if(cl[pn]<0){m=ac(cl[pn]-1);s=-ad(cl[pn]-1);if(m==0){m="-0";}}if(s<10){s="0"+s;}ce.innerHTML=""+m+":"+s;ce.style.color=((cl[pn]<31)?"#F11":"#FFF");if(pc){raf(ccd);}}function scp(n){pc=false;pn=n-1;be.src = "fondos/"+n+".jpg";var m,s;m=ac(cl[pn]);s=ad(cl[pn]);if(cl[pn]<0){m=ac(cl[pn]-1);s=-ad(cl[pn]-1);if(m==0){m="-0";}}if(s<10){s="0"+s;}ce.style.color=((cl[pn]<31)?"#F11":"#FFF");ce.innerHTML=""+m+":"+s;}function pcl(){pc=true;lpn=pn;bt=new Date();raf(ccd);}function ct(){var m,s;m=parseInt(prompt("Minutos:"));s=parseInt(prompt("s:"));m=m|0;s=s|0;dt=s+m*60;var n=cl.length;while(n--){cl[n]=dt;}scp(pn+1);}</script><style type="text/css">body{width:100%;height:100%;border: 0px;margin: 0px;overflow:hidden;}#bi{position:absolute;top:0px;left:0px;right:0px;bottom:0px;width:100%;height:100%;z-index:1;}#cl{position:absolute;top:30%;height:40%;width:100%;font-size:100px;z-index:2;text-align:center;vertical-align: middle;
color:#FFF;-webkit-text-stroke: 4px #222;text-stroke: 4px #222;-moz-text-stroke: 4px #222;}</style></head><body><img src="fondos/1.jpg" id="bi"/><div id="cl">--:--</div></body></html>