-
Notifications
You must be signed in to change notification settings - Fork 0
/
timer.html
154 lines (150 loc) · 4.69 KB
/
timer.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<!DOCTYPE html>
<html>
<script type="text/javascript" src='../movefunc.js'></script>
<script type="text/javascript" src='../posfunc.js'></script>
<link href="https://fonts.googleapis.com/css?family=Courgette|Sanchez" rel="stylesheet">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>H2O Counts</title>
</head>
<body>
<img onclick = 'run()' id="pauseplay" src="pauseplay.png" style="height: 242.88px; width: 242.88px; top: 458.62px; left: 220.1875px;">
<div id="header"></div>
<div id="altHeader">H<sub>2</sub>O Counts</div>
<a href="open.html" class="tabs" id="whyTab">Why?</a>
<a href="calibration.html" class="tabs" id="calibrateTab">Step 1</a>
<a href="timer.html" class="tabs" id="timerTab">Timer</a>
<!--<a href="about.html" class="tabs" id="aboutUsTab">About Us</a>-->
<button id="reset">Reset</button>
<button id="submit" style="height: 25.88px; width: 100.88px; top: 458.62px; left: 50.1875px;" type="button" onclick="submit()">Submit</button>
<button id="submit" style="height: 25.88px; width: 100.88px; top: 458.62px; left: 350.1875px;" type="button" onclick="reset()">Reset</button>
</body><img src="bkg3.jpg" style="height: 375.1875px; width: 736px; top: 0px; left: -10px;">
<div id="body2" style="height: 375.1875px; width: 736px; top: 375.1875px; left: -10px;"></div>
<div id="showtimer" style="height: 242.88px; width: 242.88px; top: 370.62px; left: 210.1875px;"></div>
<div id="startText" style="left: 230.1875px; top:150px"> Welcome to the timer page. This is where you time your shower. Start the timer when you get in the shower, and stop it when you get out.</div>
<body>
<style type="text/css">
#pauseplay{
position:absolute;
z-index:100;
}
#showtimer{
position:absolute;
z-index:101;
font-size:64pt;
}
/*#body2{position:absolute;
background:linear-gradient(#f3f3f3,grey) background-repeat: no-repeat ;background-position: undefined undefined ;background-size: 100% ;background-size: cover;
}*/
#body2{position:absolute;
background-image:url("altbg.png"); background-repeat: no-repeat ;background-position: undefined undefined ;background-size: 100% ;background-size: cover;
}
img{position:absolute;
background-image:url("altbg.png"); background-repeat: no-repeat ;background-position: undefined undefined ;background-size: 100% ;background-size: cover;
}
#startText{
position: relative;
left:35%;
top:70%;
color:white;
font-size: 90%;
font-family:sans-serif;
width:28%;
}#whyTab,#calibrateTab,#timerTab,#aboutUsTab{
position:fixed;
color:white;
font-size:12pt;
z-index:11;
text-decoration:none;
}#header{
position: fixed;
top:0px;
left:0px;
width:736px;
height:11%;
background-color:#48acee;
opacity: .75;
z-index:10;
}
#altHeader{
position: fixed;
top:0px;
left:2%;
width:736px;
font-size: 200%;
color:white;
font-family: 'Courgette', cursive;
z-index: 10
}body{position: absolute;
background-color:#48d7ee;
font-family: 'Sanchez', serif;
color:white;
background:background-repeat: no-repeat ;background-position: undefined undefined ;background-size: 100% ;background-size: cover;
}
#whyTab:hover,#calibrateTab:hover,#timerTab:hover,#aboutUsTab:hover{
border-style: solid;
border-color:white;
opacity: .7
}#whyTab{left:333px;
top:2.9%;
}#calibrateTab{left:402px;
top:2.9%;
}#timerTab{left:460px;
top:2.9%;
}#aboutUsTab{left:513px;
top:2.9%;
}
#submit{
z-index:10000;
position:relative;
}
</style>
<script>
var tensec=0;
var sec=0;
var min=0;
var z=2;
var time="";
var y;
var name;
var u = 1;
var usage;
var ntime;function runclock(){if(u/2==Math.floor(u/2)){
if(z!==1){
tensec++
}
if(tensec>60){tensec=00
sec++
}time = String(sec)+"."+String(tensec)
document.getElementById('showtimer').innerHTML = time
}else(clearInterval(y))
z++
};
function run() {
y=setInterval(runclock, (16+(2/3)))
u++
};
function getCookie(cname) {
var name = cname + "=";
var ca = document.cookie.split(';');
for(var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substring(1);
}
if (c.indexOf(name) == 0) {
return c.substring(name.length, c.length);
}
}
return "";
}
function submit(argument) {
usage = String(parseFloat(parseInt((1/parseFloat(getCookie("Time")))*parseFloat(time)*100)/100));
document.getElementById('showtimer').innerHTML="You used "+usage+" gallons of water";
document.getElementById('showtimer').style.fontSize = "18pt"
}function reset(argument) {
location.reload()
}
</script>
</body>
</html>