-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
218 lines (193 loc) · 7.63 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
##Music https://www.youtube.com/watch?v=lz0Xb55xdb4
##Mario sounds https://www.youtube.com/watch?v=OFP_0Zihaio
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Beat the Chasers Timer</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
background: linear-gradient(to bottom, #FF0040, #FF7F7F); /* Red-to-pink gradient */
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
color: white;
overflow: hidden; /* Prevent scrollbars */
}
.timer-container {
display: flex;
justify-content: space-evenly; /* Evenly space items */
align-items: center;
width: 100%; /* Use the full screen width */
height: 100%; /* Full height */
}
.timer-box {
position: relative;
width: 30%; /* Timer width */
height: 85%; /* Make timers taller */
border: 8px solid;
border-radius: 15px;
overflow: hidden;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
color: white;
font-weight: bold;
font-size: 50px;
box-shadow: 0 0 50px rgba(0, 0, 0, 0.6); /* Strong glow */
}
#player-timer {
border-image: linear-gradient(to bottom, #007FFF, #00BFFF) 1; /* Gradient blue border */
}
#chasers-timer {
border-image: linear-gradient(to bottom, #FF4500, #FF6347) 1; /* Gradient red border */
}
.timer-content {
position: absolute;
bottom: 0;
width: 100%;
transition: height 1s linear;
background-color: inherit;
}
#player-content {
background: linear-gradient(to top, #007FFF, #00BFFF); /* Gradient blue countdown bar */
}
#chasers-content {
background: linear-gradient(to top, #FF4500, #FF6347); /* Gradient red countdown bar */
}
.label {
position: absolute;
top: 10px;
width: 100%;
text-align: center;
font-size: 40px; /* Larger label text */
z-index: 2;
text-transform: uppercase;
color: #FFD700; /* Gold for the labels */
text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.8); /* Strong shadow */
}
.timer {
font-size: 100px; /* Larger timer numbers */
z-index: 3;
position: absolute;
top: 50%;
transform: translateY(-50%);
color: white;
text-shadow: 3px 3px 10px rgba(0, 0, 0, 0.9); /* Strong shadow for clarity */
}
.center-image {
width: 25%; /* Increase image size */
align-self: center;
box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); /* Add glow to the image */
}
</style>
</head>
<body>
<div class="timer-container">
<div id="player-timer" class="timer-box">
<div class="label" id="player-label">Shaun</div>
<div id="player-content" class="timer-content" style="height: 100%;"></div>
<div id="player-time" class="timer">60</div>
</div>
<!-- Center image -->
<img src="https://www.jotform.com/uploads/Edel_Kennedy/form_files/flying_fifteen_ireland.6731dc3385b2f5.21521112.png" alt="Flying Fifteen Ireland" class="center-image">
<div id="chasers-timer" class="timer-box">
<div class="label" id="chasers-label">Chasers</div>
<div id="chasers-content" class="timer-content" style="height: 75%;"></div>
<div id="chasers-time" class="timer">45</div>
</div>
</div>
<script>
// Configurable variables
const playerName = 'Victim1';
const chasersName = 'Chasers';
const playerStartTime = 60; // Start time for player in seconds
const chasersStartTime = 45; // Start time for chasers in seconds
const keyStartPlayer = 's';
const keyStartChasers = 'c';
const keyToggleTimers = 't';
const keyResetTimers = 'r';
const keyStopAllTimers = 'p';
// Timer state variables
let playerTime = playerStartTime;
let chasersTime = chasersStartTime;
let activeTimer = null;
let currentTimer = 'player';
// Set initial names and times
document.getElementById('player-label').innerText = playerName;
document.getElementById('chasers-label').innerText = chasersName;
document.getElementById('player-time').innerText = playerTime;
document.getElementById('chasers-time').innerText = chasersTime;
document.getElementById('chasers-content').style.height = `${(chasersTime / playerStartTime) * 100}%`;
function updateContentHeight(timerId, timeRemaining, totalTime) {
const content = document.getElementById(timerId);
const heightPercentage = (timeRemaining / totalTime) * 100;
content.style.height = `${heightPercentage}%`;
}
function startPlayerTimer() {
stopTimers();
activeTimer = setInterval(() => {
if (playerTime > 0) {
playerTime--;
document.getElementById('player-time').innerText = playerTime;
updateContentHeight('player-content', playerTime, playerStartTime);
} else {
clearInterval(activeTimer);
}
}, 1000);
currentTimer = 'player';
}
function startChasersTimer() {
stopTimers();
activeTimer = setInterval(() => {
if (chasersTime > 0) {
chasersTime--;
document.getElementById('chasers-time').innerText = chasersTime;
updateContentHeight('chasers-content', chasersTime, playerStartTime);
} else {
clearInterval(activeTimer);
}
}, 1000);
currentTimer = 'chasers';
}
function stopTimers() {
clearInterval(activeTimer);
activeTimer = null;
}
function toggleTimers() {
if (currentTimer === 'player') {
startChasersTimer();
} else {
startPlayerTimer();
}
}
function resetTimers() {
stopTimers();
playerTime = playerStartTime;
chasersTime = chasersStartTime;
document.getElementById('player-time').innerText = playerTime;
document.getElementById('chasers-time').innerText = chasersTime;
updateContentHeight('player-content', playerTime, playerStartTime);
updateContentHeight('chasers-content', chasersTime, playerStartTime);
currentTimer = 'player';
}
function stopAllTimers() {
stopTimers();
console.log("All timers stopped");
}
// Event listeners for starting, stopping, toggling, and resetting timers
document.addEventListener('keypress', (e) => {
if (e.key === keyStartPlayer) startPlayerTimer();
if (e.key === keyStartChasers) startChasersTimer();
if (e.key === keyToggleTimers) toggleTimers();
if (e.key === keyResetTimers) resetTimers();
if (e.key === keyStopAllTimers) stopAllTimers();
});
</script>
</body>
</html>