-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirst.js
More file actions
54 lines (51 loc) · 1.88 KB
/
Copy pathfirst.js
File metadata and controls
54 lines (51 loc) · 1.88 KB
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
44
45
46
47
48
49
50
51
52
53
54
function Time(){
var hours = document.getElementById("first_box");
var minutes = document.getElementById("second_box");
var a = new Date();
if (a.getHours() > 12) {
hours.innerHTML = a.getHours() - 12;
}
else {
hours.innerHTML = a.getHours();
}
if(Math.floor(a.getMinutes()/10) == 0){
minutes.innerHTML ="0"+ String(a.getMinutes())}
else{
minutes.innerHTML = a.getMinutes();
}
}
function Initiate(){
Time();
setInterval(Time,1000);
}
function Start(){
function pomo(val,val_1){
if(val[0]==0 && val_1[0]==0){
clearInterval(b);
document.getElementById("start").style.visibility = "visible";
document.getElementById("moving_box").style.visibility = "hidden";
document.getElementById("moving_box").style.animationDuration = "0s";
document.getElementById("moving_box_2").style.animationDuration = "0s";
document.getElementById("moving_box_1").style.animationDuration = "0s";
}
document.getElementById("first_box").innerHTML=val[0];
if(Math.floor(val_1[0]/10)==0){
document.getElementById("second_box").innerHTML="0"+String(val_1[0]);}
else{
document.getElementById("second_box").innerHTML =val_1;
}
if(val_1[0]==0){
val[0]=val[0]-1;
val_1[0]=59;
}
val_1[0]=val_1[0]-1;
}
document.getElementById("start").style.visibility="hidden";
document.getElementById("moving_box").style.visibility="visible";
document.getElementById("moving_box").style.animationDuration="10s";
document.getElementById("moving_box_2").style.animationDuration = "10s";
document.getElementById("moving_box_1").style.animationDuration = "10s";
var val=[19]
var val_1=[59]
var b=setInterval(pomo,1000,val,val_1)
}