-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
90 lines (77 loc) · 2.82 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CU Buffs Countdown</title>
<style>
body {
font-family: 'Arial', sans-serif;
background: linear-gradient(135deg, #000000, #ffcc00);
color: white;
text-align: center;
margin: 0;
padding: 0;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
height: 100vh;
}
h1 {
font-size: 3rem;
margin: 0.5rem 0;
text-shadow: 2px 2px 8px #000000;
}
#countdown {
font-size: 4rem;
font-weight: bold;
background: rgba(255, 255, 255, 0.2);
padding: 20px;
border-radius: 10px;
margin-top: 20px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
img {
margin-top: 30px;
max-width: 200px;
border: 3px solid #ffffff;
border-radius: 10px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<h1>Time Until the Next Buffs Game!!!</h1>
<!-- Countdown Display (First Timer) -->
<div id="countdown">Loading...</div>
<img src="buffs-logo.jpg" alt="CU Buffs Logo">
<script>
// Set the target date and time for the CU Buffs game (Saturday, November 23, 2024, 3:30 PM EST)
var targetDate = new Date(Date.UTC(2024, 10, 23, 20, 30, 0)); // Nov 23, 2024 at 3:30 PM EST (UTC-5)
// Update the countdown every 1 second
var x = setInterval(function() {
// Get the current local time in the browser
var now = new Date();
// Get the time zone offset in minutes (current time zone difference with UTC)
var timeZoneOffset = now.getTimezoneOffset(); // in minutes (UTC is ahead of local time)
// Adjust the target time to match the local time zone offset
var adjustedTargetDate = new Date(targetDate.getTime() + (timeZoneOffset * 60000)); // Convert minutes to milliseconds
// Find the distance between now and the adjusted target date
var distance = adjustedTargetDate - now;
// Time calculations for days, hours, minutes, and seconds
var days = Math.floor(distance / (1000 * 60 * 60 * 24));
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((distance % (1000 * 60)) / 1000);
// Output the result in an element with id="countdown"
document.getElementById("countdown").innerHTML = days + "d " + hours + "h " + minutes + "m " + seconds + "s ";
// If the count down is over, display "It's game time!"
if (distance < 0) {
clearInterval(x);
document.getElementById("countdown").innerHTML = "It's game time!";
}
}, 1000);
</script>
</body>
</html>