-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patht2.html
142 lines (126 loc) · 3.97 KB
/
t2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script defer src="/_vercel/insights/script.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@exampledev/[email protected]/new.min.css"
/>
<title>Half-life 3 countdown</title>
<meta
name="description"
content="barney"
/>
<script>
const debug = false
var timezone = 0
//function getnextxmas() {
//if (debug) {
// console.log("current year: " + new Date().getFullYear())}
//let nyeartstamp = toTimestamp(new Date().getFullYear()+1)/* - 43200 */
//if (debug) {
// console.log("getting timestamp using: " + toTimestamp(new Date().getFullYear()+1)/* - 43200*/)
//console.log("next nyear timestamp: " + nyeartstamp)
// console.log("converting timezones... " + nyeartstamp + " with " + timezone)
//}
//let timestampOffset = 3600 * timezone
//nyeartstamp = nyeartstamp - timestampOffset
//if (debug) {
// console.log("Is " + nyeartstamp)
// console.log("got next date!")
// }
/*return nyeartstamp
}
function toTimestamp(strDate){
var datum = Date.parse(strDate);
return datum/1000;
}*/
function calculatenyearremtime() {
let currentdate = new Date().getTime() / 1000;
let calculated = /*getnextxmas()*/1752<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script defer src="/_vercel/insights/script.js"></script>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@exampledev/[email protected]/new.min.css"
/>
<title>Half-life 3 countdown</title>
<meta
name="description"
content="barney"
/>
<script>
const debug = false
var timezone = 0
//function getnextxmas() {
//if (debug) {
// console.log("current year: " + new Date().getFullYear())}
//let nyeartstamp = toTimestamp(new Date().getFullYear()+1)/* - 43200 */
//if (debug) {
// console.log("getting timestamp using: " + toTimestamp(new Date().getFullYear()+1)/* - 43200*/)
//console.log("next nyear timestamp: " + nyeartstamp)
// console.log("converting timezones... " + nyeartstamp + " with " + timezone)
//}
//let timestampOffset = 3600 * timezone
//nyeartstamp = nyeartstamp - timestampOffset
//if (debug) {
// console.log("Is " + nyeartstamp)
// console.log("got next date!")
// }
/*return nyeartstamp
}
function toTimestamp(strDate){
var datum = Date.parse(strDate);
return datum/1000;
}*/
function calculatenyearremtime() {
let currentdate = new Date().getTime() / 1000;
let calculated = /*getnextxmas()*/ 1736683200 - currentdate
return Math.round(calculated)
}
function hrf() {
let input = calculatenyearremtime()
sec = input
min = Math.round(calculatenyearremtime() / 60 * 100) / 100
hours = Math.round(min / 60 * 100) / 100
days = Math.round(hours / 24 * 100) / 100
if (debug) {
console.log(sec + " " + min + " " + hours + " " + days)
}
}
// main
var sec = 0
var min = 0
var hours = 0
var days = 0
var updatetimer = window.setInterval(function(){
cycle()
}, 1000);
function cycle() {
hrf()
// document.getElementById("counterbox").textContent = "Sec: " + sec + ". Min: " + min + ". hours: " + hours + ". Days: " + days
document.getElementById("sec").textContent = sec + " seconds"
document.getElementById("min").textContent = min + " minutes"
document.getElementById("hrs").textContent = hours + " hours"
document.getElementById("day").textContent = days + " days"
}
</script>
</head>
<body>
<h2>Jan 12 Theory</h2>
<a href="/">Go back</a>
<div class="counter">
<span class="counter" id="sec"></span><br>
<span class="counter" id="min"></span><br>
<span class="counter" id="hrs"></span><br>
<span class="counter" id="day"></span><br>
</div>
<br><br>
<a href="https://github.com/vvv112/hl3-countdown">source code</a>
</body>
</html>