Spaces:
Running
Running
Update index.html
Browse files- index.html +683 -292
index.html
CHANGED
|
@@ -1,298 +1,689 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 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 |
-
max-width: 800px;
|
| 193 |
-
margin-top: 2rem; /* Spacing from main content */
|
| 194 |
-
padding: 1.5rem;
|
| 195 |
-
background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent dark background */
|
| 196 |
-
border-radius: 12px;
|
| 197 |
-
border: 1px solid rgba(0, 163, 165, 0.2); /* Teal border */
|
| 198 |
-
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
|
| 199 |
-
text-align: left;
|
| 200 |
-
}
|
| 201 |
-
|
| 202 |
-
#recentStreamsList {
|
| 203 |
-
list-style: none;
|
| 204 |
-
padding: 0;
|
| 205 |
-
margin: 0;
|
| 206 |
-
}
|
| 207 |
-
|
| 208 |
-
#recentStreamsList li {
|
| 209 |
-
background-color: rgba(51, 51, 51, 0.7); /* Charcoal with transparency */
|
| 210 |
-
border-radius: 8px;
|
| 211 |
-
padding: 1rem;
|
| 212 |
-
margin-bottom: 0.75rem;
|
| 213 |
-
display: flex;
|
| 214 |
-
flex-direction: column; /* Stack elements on small screens */
|
| 215 |
-
align-items: flex-start;
|
| 216 |
-
gap: 0.5rem;
|
| 217 |
-
transition: background-color 0.3s ease;
|
| 218 |
-
}
|
| 219 |
-
|
| 220 |
-
#recentStreamsList li:hover {
|
| 221 |
-
background-color: rgba(51, 51, 51, 0.9);
|
| 222 |
-
}
|
| 223 |
-
|
| 224 |
-
#recentStreamsList li:last-child {
|
| 225 |
-
margin-bottom: 0;
|
| 226 |
-
}
|
| 227 |
-
|
| 228 |
-
#recentStreamsList li a {
|
| 229 |
-
font-weight: bold;
|
| 230 |
-
color: #f88d0d; /* Gold for stream titles */
|
| 231 |
-
text-decoration: none;
|
| 232 |
-
font-size: 1.1rem;
|
| 233 |
-
transition: color 0.3s ease;
|
| 234 |
-
}
|
| 235 |
-
|
| 236 |
-
#recentStreamsList li a:hover {
|
| 237 |
-
color: #ffb74d; /* Lighter gold on hover */
|
| 238 |
-
}
|
| 239 |
-
|
| 240 |
-
#recentStreamsList li p {
|
| 241 |
-
color: #e0e0e0; /* Lighter text for dates/descriptions */
|
| 242 |
-
font-size: 0.9rem;
|
| 243 |
-
}
|
| 244 |
-
|
| 245 |
-
/* Responsive adjustments for recent streams */
|
| 246 |
-
@media (min-width: 768px) {
|
| 247 |
-
#recentStreamsList li {
|
| 248 |
-
flex-direction: row; /* Row layout on larger screens */
|
| 249 |
-
justify-content: space-between;
|
| 250 |
-
align-items: center;
|
| 251 |
-
}
|
| 252 |
-
}
|
| 253 |
-
|
| 254 |
-
</style>
|
| 255 |
</head>
|
| 256 |
<body class="bg-charcoal text-white min-h-screen flex flex-col font-sans">
|
| 257 |
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html lang="en">
|
| 3 |
<head>
|
| 4 |
+
<meta charset="UTF-8">
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
+
<title>Live Stream Countdown</title>
|
| 7 |
+
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&family=Orbitron:wght@700&display=swap" rel="stylesheet">
|
| 8 |
+
<script src="https://cdn.tailwindcss.com"></script>
|
| 9 |
+
<script>
|
| 10 |
+
// Tailwind CSS configuration for custom colors and fonts
|
| 11 |
+
tailwind.config = {
|
| 12 |
+
theme: {
|
| 13 |
+
extend: {
|
| 14 |
+
colors: {
|
| 15 |
+
magenta: '#7e0039',
|
| 16 |
+
gold: '#f88d0d',
|
| 17 |
+
grey: '#666666',
|
| 18 |
+
charcoal: '#333333',
|
| 19 |
+
teal: '#00a3a5',
|
| 20 |
+
�� warmgrey: '#8a7b71',
|
| 21 |
+
green: '#3d7061',
|
| 22 |
+
orange: '#bb3900',
|
| 23 |
+
eucalypt: '#909a8a',
|
| 24 |
+
sandstone: '#ab8a5c'
|
| 25 |
+
},
|
| 26 |
+
fontFamily: {
|
| 27 |
+
sans: ['Inter', 'sans-serif'], // Default sans-serif
|
| 28 |
+
display: ['Orbitron', 'sans-serif'], // For countdown digits and titles
|
| 29 |
+
}
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
}
|
| 33 |
+
</script>
|
| 34 |
+
<style>
|
| 35 |
+
/* Prevent scrollbars caused by absolute/fixed positioned particles */
|
| 36 |
+
body {
|
| 37 |
+
overflow: hidden;
|
| 38 |
+
/* Dynamic Gradient Background */
|
| 39 |
+
background: linear-gradient(135deg, #7e0039, #333333, #00a3a5); /* Initial gradient */
|
| 40 |
+
background-size: 400% 400%; /* Make gradient larger than viewport */
|
| 41 |
+
/* Changed animation duration to 60s for slower change */
|
| 42 |
+
animation: gradientAnimation 60s ease infinite; /* Animate gradient */
|
| 43 |
+
}
|
| 44 |
+
|
| 45 |
+
@keyframes gradientAnimation {
|
| 46 |
+
0% { background-position: 0% 50%; }
|
| 47 |
+
50% { background-position: 100% 50%; }
|
| 48 |
+
100% { background-position: 0% 50%; }
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
/* Text glow effect */
|
| 52 |
+
.glow-text {
|
| 53 |
+
text-shadow: 0 0 10px rgba(248, 141, 13, 0.7);
|
| 54 |
+
}
|
| 55 |
+
/* Pulse animation for the join button */
|
| 56 |
+
.pulse {
|
| 57 |
+
animation: pulse 2s infinite;
|
| 58 |
+
}
|
| 59 |
+
@keyframes pulse {
|
| 60 |
+
0% { transform: scale(1); }
|
| 61 |
+
50% { transform: scale(1.05); }
|
| 62 |
+
100% { transform: scale(1); }
|
| 63 |
+
}
|
| 64 |
+
/* Modal styles for showing/hiding with transitions */
|
| 65 |
+
.modal {
|
| 66 |
+
transition: all 0.3s ease;
|
| 67 |
+
background-color: rgba(0,0,0,0); /* Start transparent overlay */
|
| 68 |
+
opacity: 0;
|
| 69 |
+
pointer-events: none; /* Don't block clicks when hidden */
|
| 70 |
+
}
|
| 71 |
+
.modal.active {
|
| 72 |
+
opacity: 1;
|
| 73 |
+
background-color: rgba(0,0,0,0.8); /* Dark overlay when active */
|
| 74 |
+
pointer-events: auto; /* Allow clicks when active */
|
| 75 |
+
}
|
| 76 |
+
.modal-content {
|
| 77 |
+
transform: translateY(-20px); /* Start slightly up */
|
| 78 |
+
opacity: 0;
|
| 79 |
+
transition: all 0.3s ease;
|
| 80 |
+
}
|
| 81 |
+
.modal.active .modal-content {
|
| 82 |
+
transform: translateY(0); /* Slide into place */
|
| 83 |
+
opacity: 1;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
/* Ripple Effect Styles */
|
| 87 |
+
/* Apply to the clickable elements within the countdown */
|
| 88 |
+
.countdown-digit {
|
| 89 |
+
position: relative; /* Needed for ripple positioning */
|
| 90 |
+
overflow: hidden; /* Hide ripple outside the element */
|
| 91 |
+
cursor: pointer; /* Indicate interactivity */
|
| 92 |
+
transform: translateZ(0); /* Improve performance */
|
| 93 |
+
}
|
| 94 |
+
|
| 95 |
+
.ripple {
|
| 96 |
+
position: absolute;
|
| 97 |
+
border-radius: 50%;
|
| 98 |
+
transform: scale(0);
|
| 99 |
+
animation: ripple 0.6s linear;
|
| 100 |
+
background-color: rgba(255, 255, 255, 0.5); /* White ripple with transparency */
|
| 101 |
+
pointer-events: none; /* Don't interfere with clicks */
|
| 102 |
+
}
|
| 103 |
+
|
| 104 |
+
@keyframes ripple {
|
| 105 |
+
to {
|
| 106 |
+
transform: scale(4);
|
| 107 |
+
opacity: 0;
|
| 108 |
+
}
|
| 109 |
+
}
|
| 110 |
+
|
| 111 |
+
/* Particle Styles */
|
| 112 |
+
/* Container to hold particles and position them */
|
| 113 |
+
.particles-container {
|
| 114 |
+
position: fixed;
|
| 115 |
+
top: 0;
|
| 116 |
+
left: 0;
|
| 117 |
+
width: 100%;
|
| 118 |
+
height: 100%;
|
| 119 |
+
pointer-events: none; /* Don't block interaction with content */
|
| 120 |
+
z-index: -1; /* Place behind content */
|
| 121 |
+
}
|
| 122 |
+
|
| 123 |
+
/* Individual particle style */
|
| 124 |
+
.particle {
|
| 125 |
+
position: absolute;
|
| 126 |
+
width: 5px;
|
| 127 |
+
height: 5px;
|
| 128 |
+
background-color: rgba(248, 141, 13, 0.6); /* Gold color with transparency */
|
| 129 |
+
border-radius: 50%;
|
| 130 |
+
opacity: 0.8;
|
| 131 |
+
/* Initial animation (will be overridden by JS for random movement) */
|
| 132 |
+
animation: float 15s ease-in-out infinite alternate;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
/* Add variations for different particles */
|
| 136 |
+
.particle:nth-child(2n) {
|
| 137 |
+
width: 3px;
|
| 138 |
+
height: 3px;
|
| 139 |
+
background-color: rgba(0, 163, 165, 0.6); /* Teal color */
|
| 140 |
+
animation-duration: 20s;
|
| 141 |
+
}
|
| 142 |
+
.particle:nth-child(3n) {
|
| 143 |
+
width: 7px;
|
| 144 |
+
height: 7px;
|
| 145 |
+
background-color: rgba(138, 123, 113, 0.6); /* Warmgrey color */
|
| 146 |
+
animation-duration: 25s;
|
| 147 |
+
}
|
| 148 |
+
.particle:nth-child(4n) {
|
| 149 |
+
width: 4px;
|
| 150 |
+
height: 4px;
|
| 151 |
+
background-color: rgba(171, 138, 92, 0.6); /* Sandstone color */
|
| 152 |
+
animation-duration: 18s;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
|
| 156 |
+
/* Basic float keyframes (used as a fallback/starting point) */
|
| 157 |
+
@keyframes float {
|
| 158 |
+
0% { transform: translate(0, 0); }
|
| 159 |
+
100% { transform: translate(50px, 50px); } /* Dummy values, JS will set random ones */
|
| 160 |
+
}
|
| 161 |
+
|
| 162 |
+
/* Progress Bar Styles */
|
| 163 |
+
.progress-bar-container {
|
| 164 |
+
width: 80%; /* Adjust width as needed */
|
| 165 |
+
max-width: 600px;
|
| 166 |
+
height: 15px;
|
| 167 |
+
background-color: rgba(102, 102, 102, 0.3); /* Grey with transparency */
|
| 168 |
+
border-radius: 8px;
|
| 169 |
+
margin: 20px auto; /* Center the bar */
|
| 170 |
+
overflow: hidden; /* Hide overflowing progress */
|
| 171 |
+
}
|
| 172 |
+
|
| 173 |
+
.progress-bar {
|
| 174 |
+
height: 100%;
|
| 175 |
+
width: 100%; /* Starts full */
|
| 176 |
+
background: linear-gradient(to right, #00a3a5, #f88d0d); /* Teal to Gold gradient */
|
| 177 |
+
border-radius: 8px;
|
| 178 |
+
transition: width 1s linear; /* Smooth transition for the bar */
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
/* Countdown Digit Animation (Subtle Scale) */
|
| 182 |
+
.countdown-digit > div { /* Target the inner div with the number */
|
| 183 |
+
transition: transform 0.3s ease-out; /* Smooth transition */
|
| 184 |
+
}
|
| 185 |
+
/* Optional: Add a class in JS to trigger animation on update */
|
| 186 |
+
.countdown-digit > div.animate-scale {
|
| 187 |
+
transform: scale(1.1);
|
| 188 |
+
}
|
| 189 |
+
|
| 190 |
+
|
| 191 |
+
</style>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 192 |
</head>
|
| 193 |
<body class="bg-charcoal text-white min-h-screen flex flex-col font-sans">
|
| 194 |
|
| 195 |
+
<div class="particles-container">
|
| 196 |
+
<div class="particle" style="top: 10%; left: 20%;"></div>
|
| 197 |
+
<div class="particle" style="top: 50%; left: 80%;"></div>
|
| 198 |
+
<div class="particle" style="top: 80%; left: 40%;"></div>
|
| 199 |
+
<div class="particle" style="top: 30%; left: 60%;"></div>
|
| 200 |
+
<div class="particle" style="top: 70%; left: 10%;"></div>
|
| 201 |
+
<div class="particle" style="top: 20%; left: 90%;"></div>
|
| 202 |
+
<div class="particle" style="top: 60%; left: 30%;"></div>
|
| 203 |
+
<div class="particle" style="top: 40%; left: 70%;"></div>
|
| 204 |
+
<div class="particle" style="top: 90%; left: 50%;"></div>
|
| 205 |
+
<div class="particle" style="top: 5%; left: 5%;"></div>
|
| 206 |
+
<div class="particle" style="top: 95%; left: 95%;"></div>
|
| 207 |
+
<div class="particle" style="top: 15%; left: 75%;"></div>
|
| 208 |
+
<div class="particle" style="top: 85%; left: 25%;"></div>
|
| 209 |
+
</div>
|
| 210 |
+
|
| 211 |
+
|
| 212 |
+
<div class="fixed top-4 right-4 flex space-x-4 z-50">
|
| 213 |
+
<a href="recent-streams.html" class="bg-teal hover:bg-opacity-80 text-white p-2 px-4 rounded-full shadow-lg transition duration-300 ease-in-out transform hover:scale-110 flex items-center justify-center text-sm font-semibold">
|
| 214 |
+
Recent Streams
|
| 215 |
+
</a>
|
| 216 |
+
<button id="adminBtn" class="bg-magenta hover:bg-opacity-80 text-white p-2 rounded-full shadow-lg transition duration-300 ease-in-out transform hover:scale-110" title="Admin Settings">
|
| 217 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 218 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z" />
|
| 219 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" />
|
| 220 |
+
</svg>
|
| 221 |
+
</button>
|
| 222 |
+
</div>
|
| 223 |
+
|
| 224 |
+
<main class="flex-grow flex flex-col items-center justify-center px-4 text-center relative z-10">
|
| 225 |
+
<div class="max-w-4xl w-full">
|
| 226 |
+
<h1 class="text-4xl md:text-6xl font-display mb-8 glow-text text-gold">Live Stream Starting Soon</h1>
|
| 227 |
+
|
| 228 |
+
<div class="bg-opacity-20 bg-magenta backdrop-filter backdrop-blur-lg rounded-xl p-8 mb-12 border border-teal border-opacity-30">
|
| 229 |
+
<h2 class="text-2xl md:text-3xl font-display font-semibold mb-6 text-eucalypt">Join us for an exciting event</h2>
|
| 230 |
+
<p class="text-lg text-warmgrey mb-8">The stream will begin automatically when the countdown reaches zero.</p>
|
| 231 |
+
|
| 232 |
+
<p id="preStreamMessage" class="text-xl font-bold text-orange mb-8 hidden">Stream starting in less than 5 minutes!</p>
|
| 233 |
+
|
| 234 |
+
<div class="flex justify-center mb-8">
|
| 235 |
+
<div id="countdown" class="grid grid-cols-4 gap-4 w-full max-w-2xl font-display">
|
| 236 |
+
<div class="bg-charcoal bg-opacity-70 rounded-lg p-4 border border-gold border-opacity-30 countdown-digit">
|
| 237 |
+
<div id="days" class="text-5xl md:text-7xl font-bold text-gold">00</div>
|
| 238 |
+
<div class="text-sm uppercase text-sandstone">Days</div>
|
| 239 |
+
</div>
|
| 240 |
+
<div class="bg-charcoal bg-opacity-70 rounded-lg p-4 border border-gold border-opacity-30 countdown-digit">
|
| 241 |
+
<div id="hours" class="text-5xl md:text-7xl font-bold text-gold">00</div>
|
| 242 |
+
<div class="text-sm uppercase text-sandstone">Hours</div>
|
| 243 |
+
</div>
|
| 244 |
+
<div class="bg-charcoal bg-opacity-70 rounded-lg p-4 border border-gold border-opacity-30 countdown-digit">
|
| 245 |
+
<div id="minutes" class="text-5xl md:text-7xl font-bold text-gold">00</div>
|
| 246 |
+
<div class="text-sm uppercase text-sandstone">Minutes</div>
|
| 247 |
+
</div>
|
| 248 |
+
<div class="bg-charcoal bg-opacity-70 rounded-lg p-4 border border-gold border-opacity-30 countdown-digit">
|
| 249 |
+
<div id="seconds" class="text-5xl md:text-7xl font-bold text-gold">00</div>
|
| 250 |
+
<div class="text-sm uppercase text-sandstone">Seconds</div>
|
| 251 |
+
</div>
|
| 252 |
+
</div>
|
| 253 |
+
</div>
|
| 254 |
+
|
| 255 |
+
<div class="progress-bar-container">
|
| 256 |
+
<div id="progressBar" class="progress-bar"></div>
|
| 257 |
+
</div>
|
| 258 |
+
|
| 259 |
+
|
| 260 |
+
<div id="streamReady" class="hidden pulse">
|
| 261 |
+
<a id="streamLink" href="#" target="_blank" class="inline-block bg-orange hover:bg-opacity-90 text-white font-bold py-4 px-8 rounded-full text-xl transition-all transform hover:scale-105">
|
| 262 |
+
Join Live Stream Now
|
| 263 |
+
</a>
|
| 264 |
+
</div>
|
| 265 |
+
</div>
|
| 266 |
+
|
| 267 |
+
<div class="text-grey">
|
| 268 |
+
<p class="mt-2 text-sm">Stream will begin on: <span id="streamTimeDisplay" class="font-medium text-teal">Loading...</span> <span id="timezoneDisplay" class="font-medium text-eucalypt text-xs">(Your Local Time)</span></p>
|
| 269 |
+
<p id="errorDisplay" class="mt-2 text-sm text-orange font-semibold"></p> </div>
|
| 270 |
+
</div>
|
| 271 |
+
</main>
|
| 272 |
+
|
| 273 |
+
<footer class="py-6 text-center text-warmgrey text-sm relative z-10">
|
| 274 |
+
<p>© <span id="currentYear"></span> Live Stream Countdown. All rights reserved.</p>
|
| 275 |
+
</footer>
|
| 276 |
+
|
| 277 |
+
<div id="adminModal" class="modal fixed inset-0 flex items-center justify-center p-4 z-50">
|
| 278 |
+
<div class="modal-content bg-charcoal rounded-xl max-w-md w-full p-6 border border-magenta border-opacity-50 text-center">
|
| 279 |
+
<div class="flex justify-between items-center mb-4">
|
| 280 |
+
<h3 class="text-xl font-bold text-gold">Admin Settings</h3>
|
| 281 |
+
<button id="closeModal" class="text-grey hover:text-white">
|
| 282 |
+
<svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
|
| 283 |
+
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
| 284 |
+
</svg>
|
| 285 |
+
</button>
|
| 286 |
+
</div>
|
| 287 |
+
|
| 288 |
+
<p class="mb-4 text-warmgrey text-left">
|
| 289 |
+
This countdown is controlled by a Google Sheet. To update the stream date, time, or URL, you need to edit the sheet directly.
|
| 290 |
+
</p>
|
| 291 |
+
<p class="mb-4 text-orange text-sm text-left font-semibold">
|
| 292 |
+
Remember: After editing the sheet, you MUST re-publish it to the web (as CSV) for changes to appear here on the page.
|
| 293 |
+
</p>
|
| 294 |
+
|
| 295 |
+
<a id="editSheetLink" href="https://docs.google.com/spreadsheets/d/1XQ8ZDLZvU9lz4kNu9Zn3SXBIuIwniuLG4pVEfk_5NkU/edit?gid=1249364277#gid=1249364277" target="_blank" class="inline-block w-full bg-teal hover:bg-opacity-80 text-white py-3 rounded font-bold transition duration-300 ease-in-out transform hover:scale-105">
|
| 296 |
+
Edit Google Sheet
|
| 297 |
+
</a>
|
| 298 |
+
|
| 299 |
+
<div id="messageArea" class="mt-4 text-center text-sm"></div>
|
| 300 |
+
</div>
|
| 301 |
+
</div>
|
| 302 |
+
|
| 303 |
+
<audio id="countdownEndSound" src="https://github.com/selli106/avlink/raw/refs/heads/main/ding-36029.mp3" preload="auto"></audio>
|
| 304 |
+
|
| 305 |
+
|
| 306 |
+
<script>
|
| 307 |
+
// --- Configuration ---
|
| 308 |
+
// Your Google Sheet Published CSV URL
|
| 309 |
+
// (File > Share > Publish to web > Choose sheet & CSV > Publish)
|
| 310 |
+
// Make sure the sheet contains rows with 'key,value' like 'countdown_date,YYYY-MM-DDTHH:mm:ssZ' and 'stream_url,your_url_here'
|
| 311 |
+
const sheetCsvUrl = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSy-8e3C5trnUBXhMnpHxOmWEqB61875RPY0nCIIGCpw3UnU9SK31dt8iqqYzgeUziBkAWdo5qQ8wnd/pub?output=csv";
|
| 312 |
+
// Your Google Sheet Edit URL
|
| 313 |
+
// (The standard URL from your browser's address bar when editing)
|
| 314 |
+
const googleSheetEditUrl = "https://docs.google.com/spreadsheets/d/1XQ8ZDLZvU9lz4kNu9Zn3SXBIuIwniuLG4pVEfk_5NkU/edit?gid=1249364277#gid=1249364277";
|
| 315 |
+
// How often to fetch settings from the sheet (in milliseconds)
|
| 316 |
+
const fetchInterval = 60000; // 1 minute
|
| 317 |
+
// Threshold for pre-stream message (in milliseconds)
|
| 318 |
+
const preStreamThreshold = 5 * 60 * 1000; // 5 minutes
|
| 319 |
+
|
| 320 |
+
|
| 321 |
+
// --- DOM Elements ---
|
| 322 |
+
const adminBtn = document.getElementById('adminBtn');
|
| 323 |
+
const adminModal = document.getElementById('adminModal');
|
| 324 |
+
const closeModal = document.getElementById('closeModal');
|
| 325 |
+
const editSheetLink = document.getElementById('editSheetLink');
|
| 326 |
+
const messageArea = document.getElementById('messageArea'); // Used in modal for fetch status
|
| 327 |
+
const errorDisplay = document.getElementById('errorDisplay'); // Used below countdown for fetch errors
|
| 328 |
+
const countdownDisplay = document.getElementById('countdown');
|
| 329 |
+
const streamReady = document.getElementById('streamReady');
|
| 330 |
+
const streamLink = document.getElementById('streamLink');
|
| 331 |
+
const streamTimeDisplay = document.getElementById('streamTimeDisplay');
|
| 332 |
+
const timezoneDisplay = document.getElementById('timezoneDisplay');
|
| 333 |
+
const currentYear = document.getElementById('currentYear');
|
| 334 |
+
|
| 335 |
+
const daysElement = document.getElementById('days');
|
| 336 |
+
const hoursElement = document.getElementById('hours');
|
| 337 |
+
const minutesElement = document.getElementById('minutes');
|
| 338 |
+
const secondsElement = document.getElementById('seconds');
|
| 339 |
+
|
| 340 |
+
// Elements for new features
|
| 341 |
+
const preStreamMessageElement = document.getElementById('preStreamMessage');
|
| 342 |
+
const countdownEndSound = document.getElementById('countdownEndSound');
|
| 343 |
+
const progressBar = document.getElementById('progressBar');
|
| 344 |
+
|
| 345 |
+
|
| 346 |
+
// Elements for effects
|
| 347 |
+
const countdownDigits = document.querySelectorAll('.countdown-digit');
|
| 348 |
+
const particles = document.querySelectorAll('.particle');
|
| 349 |
+
|
| 350 |
+
|
| 351 |
+
// --- State Variables ---
|
| 352 |
+
let countdownInterval;
|
| 353 |
+
let currentStreamTargetUrl = '#'; // Default URL
|
| 354 |
+
let currentCountdownDateString = null; // Store the date string from the sheet
|
| 355 |
+
let initialCountdownDuration = 0; // Store the total duration for the progress bar
|
| 356 |
+
|
| 357 |
+
|
| 358 |
+
// --- Functions ---
|
| 359 |
+
|
| 360 |
+
// Fetches settings from the Google Sheet CSV
|
| 361 |
+
async function fetchSettings(csvUrl) {
|
| 362 |
+
try {
|
| 363 |
+
// Clear previous errors
|
| 364 |
+
errorDisplay.textContent = '';
|
| 365 |
+
|
| 366 |
+
const response = await fetch(csvUrl);
|
| 367 |
+
if (!response.ok) {
|
| 368 |
+
// Attempt to read body for more specific error if possible, otherwise use status
|
| 369 |
+
const errorBody = await response.text().catch(() => `Status: ${response.status}`);
|
| 370 |
+
throw new Error(`HTTP error fetching sheet: ${response.status} - ${errorBody.substring(0, 100)}...`); // Limit error body length
|
| 371 |
+
}
|
| 372 |
+
const data = await response.text();
|
| 373 |
+
const rows = data.split("\n").map(row => row.split(",").map(cell => cell.trim())); // Split rows and cells, trim whitespace
|
| 374 |
+
|
| 375 |
+
let dateString = null;
|
| 376 |
+
let urlString = null;
|
| 377 |
+
|
| 378 |
+
// Parse rows to find settings
|
| 379 |
+
for (const row of rows) {
|
| 380 |
+
if (row.length >= 2) { // Ensure row has at least key and value columns
|
| 381 |
+
const key = row[0];
|
| 382 |
+
const value = row[1];
|
| 383 |
+
if (key === "countdown_date") {
|
| 384 |
+
dateString = value;
|
| 385 |
+
} else if (key === "stream_url") {
|
| 386 |
+
urlString = value;
|
| 387 |
+
}
|
| 388 |
+
}
|
| 389 |
+
}
|
| 390 |
+
|
| 391 |
+
if (dateString && urlString) {
|
| 392 |
+
// Only update if both values are found and are different from current settings
|
| 393 |
+
if (dateString !== currentCountdownDateString || urlString !== currentStreamTargetUrl) {
|
| 394 |
+
currentCountdownDateString = dateString;
|
| 395 |
+
currentStreamTargetUrl = urlString;
|
| 396 |
+
console.log("Settings fetched successfully:", { date: currentCountdownDateString, url: currentStreamTargetUrl });
|
| 397 |
+
// Restart countdown with new settings
|
| 398 |
+
startCountdown(currentCountdownDateString, currentStreamTargetUrl);
|
| 399 |
+
} else {
|
| 400 |
+
console.log("Settings fetched, no changes detected.");
|
| 401 |
+
// Continue the existing countdown if no changes
|
| 402 |
+
}
|
| 403 |
+
|
| 404 |
+
} else {
|
| 405 |
+
errorDisplay.textContent = 'Error: Settings (countdown_date or stream_url) not found in Google Sheet.';
|
| 406 |
+
console.error("Missing required settings (countdown_date or stream_url) in Google Sheet CSV data.");
|
| 407 |
+
// Indicate error to user and stop countdown if essential data is missing
|
| 408 |
+
countdownDisplay.textContent = "Error loading settings.";
|
| 409 |
+
clearInterval(countdownInterval);
|
| 410 |
+
streamReady.classList.add('hidden');
|
| 411 |
+
preStreamMessageElement.classList.add('hidden'); // Hide pre-stream message
|
| 412 |
+
progressBar.style.width = '0%'; // Reset progress bar
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
} catch (error) {
|
| 416 |
+
errorDisplay.textContent = 'Error fetching settings. Check sheet URL and publish status.';
|
| 417 |
+
console.error("Failed to fetch settings from Google Sheet:", error);
|
| 418 |
+
// Indicate error to user and stop countdown on fetch error
|
| 419 |
+
countdownDisplay.textContent = "Error fetching settings.";
|
| 420 |
+
clearInterval(countdownInterval);
|
| 421 |
+
streamReady.classList.add('hidden');
|
| 422 |
+
preStreamMessageElement.classList.add('hidden'); // Hide pre-stream message
|
| 423 |
+
progressBar.style.width = '0%'; // Reset progress bar
|
| 424 |
+
}
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
|
| 428 |
+
// Starts or updates the countdown timer
|
| 429 |
+
function startCountdown(dateString, streamTargetUrl) {
|
| 430 |
+
// Clear any existing interval before starting a new one
|
| 431 |
+
clearInterval(countdownInterval);
|
| 432 |
+
|
| 433 |
+
// --- Debugging Log ---
|
| 434 |
+
console.log("Parsing date string:", dateString);
|
| 435 |
+
const targetDate = new Date(dateString);
|
| 436 |
+
console.log("Parsed Date object:", targetDate);
|
| 437 |
+
const targetTimestamp = targetDate.getTime();
|
| 438 |
+
console.log("Target Timestamp (ms):", targetTimestamp);
|
| 439 |
+
// --- End Debugging Log ---
|
| 440 |
+
|
| 441 |
+
|
| 442 |
+
// Check if the parsed date is valid
|
| 443 |
+
if (isNaN(targetTimestamp)) {
|
| 444 |
+
errorDisplay.textContent = `Error: Invalid date format from sheet: ${dateString}`;
|
| 445 |
+
console.error("Invalid date string received from Google Sheet:", dateString);
|
| 446 |
+
countdownDisplay.textContent = "Error loading settings.";
|
| 447 |
+
clearInterval(countdownInterval);
|
| 448 |
+
streamReady.classList.add('hidden');
|
| 449 |
+
preStreamMessageElement.classList.add('hidden'); // Hide pre-stream message
|
| 450 |
+
progressBar.style.width = '0%'; // Reset progress bar
|
| 451 |
+
streamTimeDisplay.textContent = "Invalid Date";
|
| 452 |
+
timezoneDisplay.textContent = "";
|
| 453 |
+
return; // Stop execution if date is invalid
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
// Calculate the initial duration for the progress bar
|
| 457 |
+
const now = new Date().getTime();
|
| 458 |
+
initialCountdownDuration = targetTimestamp - now;
|
| 459 |
+
// Prevent negative duration if date is in the past
|
| 460 |
+
if (initialCountdownDuration < 0) {
|
| 461 |
+
initialCountdownDuration = 0;
|
| 462 |
+
}
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
// Update display immediately
|
| 466 |
+
updateCountdown(targetTimestamp, streamTargetUrl);
|
| 467 |
+
|
| 468 |
+
// Set interval to update every second
|
| 469 |
+
countdownInterval = setInterval(() => {
|
| 470 |
+
updateCountdown(targetTimestamp, streamTargetUrl);
|
| 471 |
+
}, 1000);
|
| 472 |
+
|
| 473 |
+
// Update the display below the countdown with the target time
|
| 474 |
+
const options = {
|
| 475 |
+
weekday: 'long',
|
| 476 |
+
year: 'numeric',
|
| 477 |
+
month: 'long',
|
| 478 |
+
day: 'numeric',
|
| 479 |
+
hour: '2-digit',
|
| 480 |
+
minute: '2-digit',
|
| 481 |
+
timeZoneName: 'short' // Show the user's local timezone abbreviation
|
| 482 |
+
};
|
| 483 |
+
// Use the Date object created from the string for consistent display
|
| 484 |
+
// Note: This displays the target moment converted to the *user's* local time zone.
|
| 485 |
+
try {
|
| 486 |
+
streamTimeDisplay.textContent = targetDate.toLocaleString(undefined, options); // Use the parsed Date object
|
| 487 |
+
timezoneDisplay.textContent = "(Your Local Time)"; // Indicate this is local time
|
| 488 |
+
} catch (e) {
|
| 489 |
+
// Handle potential invalid date string parsing errors (less likely now with isNaN check)
|
| 490 |
+
streamTimeDisplay.textContent = `Error formatting date: ${dateString}`;
|
| 491 |
+
timezoneDisplay.textContent = "";
|
| 492 |
+
console.error("Error formatting date string:", dateString, e);
|
| 493 |
+
}
|
| 494 |
+
|
| 495 |
+
|
| 496 |
+
// Ensure the countdown display is visible if the date is in the future
|
| 497 |
+
if (targetTimestamp > new Date().getTime()) {
|
| 498 |
+
countdownDisplay.classList.remove('hidden'); // Make sure grid is visible
|
| 499 |
+
// Ensure individual elements are visible if the parent was hidden
|
| 500 |
+
if(daysElement) daysElement.parentElement.classList.remove('hidden');
|
| 501 |
+
if(hoursElement) hoursElement.parentElement.classList.remove('hidden');
|
| 502 |
+
if(minutesElement) minutesElement.parentElement.classList.remove('hidden');
|
| 503 |
+
if(secondsElement) secondsElement.parentElement.classList.remove('hidden');
|
| 504 |
+
|
| 505 |
+
streamReady.classList.add('hidden');
|
| 506 |
+
}
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
|
| 510 |
+
// Updates the countdown display and handles pre-stream message/progress bar
|
| 511 |
+
function updateCountdown(targetTimestamp, streamTargetUrl) { // Accepts timestamp now
|
| 512 |
+
const now = new Date().getTime();
|
| 513 |
+
const distance = targetTimestamp - now;
|
| 514 |
+
|
| 515 |
+
// --- Progress Bar Update ---
|
| 516 |
+
let progressPercentage = 100; // Start full
|
| 517 |
+
if (initialCountdownDuration > 0) {
|
| 518 |
+
progressPercentage = Math.max(0, (distance / initialCountdownDuration) * 100);
|
| 519 |
+
}
|
| 520 |
+
progressBar.style.width = `${progressPercentage}%`;
|
| 521 |
+
|
| 522 |
+
|
| 523 |
+
if (distance < 0) {
|
| 524 |
+
// Stream time has passed
|
| 525 |
+
clearInterval(countdownInterval);
|
| 526 |
+
countdownDisplay.classList.add('hidden'); // Hide the grid container
|
| 527 |
+
streamReady.classList.remove('hidden'); // Show the join button
|
| 528 |
+
preStreamMessageElement.classList.add('hidden'); // Hide pre-stream message
|
| 529 |
+
|
| 530 |
+
// Ensure stream link is correctly set one last time
|
| 531 |
+
streamLink.href = streamTargetUrl;
|
| 532 |
+
streamLink.target = "_blank"; // Ensure it opens in a new tab
|
| 533 |
+
|
| 534 |
+
streamTimeDisplay.textContent = "Stream should be live now!";
|
| 535 |
+
timezoneDisplay.textContent = ""; // Clear timezone note
|
| 536 |
+
errorDisplay.textContent = ""; // Clear any lingering error messages
|
| 537 |
+
|
| 538 |
+
// Play sound effect (if loaded and allowed by browser)
|
| 539 |
+
if (countdownEndSound) {
|
| 540 |
+
countdownEndSound.play().catch(e => console.warn("Audio playback blocked:", e));
|
| 541 |
+
}
|
| 542 |
+
|
| 543 |
+
// Optional: Automatically redirect after a delay or on user interaction
|
| 544 |
+
// For automatic redirect, use: window.open(streamTargetUrl, "_blank");
|
| 545 |
+
// Added target="_blank" above to the link itself which is usually sufficient.
|
| 546 |
+
|
| 547 |
+
return;
|
| 548 |
+
}
|
| 549 |
+
|
| 550 |
+
// --- Pre-stream Message ---
|
| 551 |
+
if (distance <= preStreamThreshold) {
|
| 552 |
+
preStreamMessageElement.classList.remove('hidden');
|
| 553 |
+
} else {
|
| 554 |
+
preStreamMessageElement.classList.add('hidden');
|
| 555 |
+
}
|
| 556 |
+
|
| 557 |
+
|
| 558 |
+
// Calculate time units
|
| 559 |
+
const days = Math.floor(distance / (1000 * 60 * 60 * 24));
|
| 560 |
+
const hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
|
| 561 |
+
const minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
|
| 562 |
+
const seconds = Math.floor((distance % (1000 * 60)) / 1000);
|
| 563 |
+
|
| 564 |
+
// Update display elements, using ?.textContent for safety just in case
|
| 565 |
+
// Add a temporary class to trigger animation
|
| 566 |
+
const updateDigit = (element, value) => {
|
| 567 |
+
const stringValue = value.toString().padStart(2, '0');
|
| 568 |
+
if (element && element.textContent !== stringValue) {
|
| 569 |
+
element.textContent = stringValue;
|
| 570 |
+
// Trigger animation class
|
| 571 |
+
element.classList.add('animate-scale');
|
| 572 |
+
// Remove class after animation duration
|
| 573 |
+
setTimeout(() => {
|
| 574 |
+
element.classList.remove('animate-scale');
|
| 575 |
+
}, 300); // Match CSS transition duration
|
| 576 |
+
} else if (element) {
|
| 577 |
+
element.textContent = stringValue; // Update even if value is same, just in case
|
| 578 |
+
}
|
| 579 |
+
};
|
| 580 |
+
|
| 581 |
+
updateDigit(daysElement, days);
|
| 582 |
+
updateDigit(hoursElement, hours);
|
| 583 |
+
updateDigit(minutesElement, minutes);
|
| 584 |
+
updateDigit(secondsElement, seconds);
|
| 585 |
+
|
| 586 |
+
|
| 587 |
+
// Ensure countdown elements are visible if they were hidden after countdown ended previously
|
| 588 |
+
countdownDisplay.classList.remove('hidden');
|
| 589 |
+
streamReady.classList.add('hidden');
|
| 590 |
+
// Also make sure the individual number divs are not hidden if you added display:none to them
|
| 591 |
+
if(daysElement && daysElement.parentElement.classList.contains('hidden')) daysElement.parentElement.classList.remove('hidden');
|
| 592 |
+
if(hoursElement && hoursElement.parentElement.classList.contains('hidden')) hoursElement.parentElement.classList.remove('hidden');
|
| 593 |
+
if(minutesElement && minutesElement.parentElement.classList.contains('hidden')) minutesElement.parentElement.classList.remove('hidden');
|
| 594 |
+
if(secondsElement && secondsElement.parentElement.classList.contains('hidden')) secondsElement.parentElement.classList.remove('hidden');
|
| 595 |
+
|
| 596 |
+
}
|
| 597 |
+
|
| 598 |
+
|
| 599 |
+
// --- Effects Functions ---
|
| 600 |
+
|
| 601 |
+
// Create ripple effect on countdown digits
|
| 602 |
+
function createRipple(event) {
|
| 603 |
+
const element = event.currentTarget;
|
| 604 |
+
const circle = document.createElement('span');
|
| 605 |
+
const diameter = Math.max(element.clientWidth, element.clientHeight);
|
| 606 |
+
const radius = diameter / 2;
|
| 607 |
+
|
| 608 |
+
circle.style.width = circle.style.height = `${diameter}px`;
|
| 609 |
+
circle.style.left = `${event.clientX - element.getBoundingClientRect().left - radius}px`;
|
| 610 |
+
circle.style.top = `${event.clientY - element.getBoundingClientRect().top - radius}px`;
|
| 611 |
+
circle.classList.add('ripple');
|
| 612 |
+
|
| 613 |
+
// Remove any existing ripple before adding a new one
|
| 614 |
+
const ripple = element.getElementsByClassName('ripple')[0];
|
| 615 |
+
if (ripple) {
|
| 616 |
+
ripple.remove();
|
| 617 |
+
}
|
| 618 |
+
|
| 619 |
+
element.appendChild(circle);
|
| 620 |
+
}
|
| 621 |
+
|
| 622 |
+
// Animate floating particles
|
| 623 |
+
function animateParticles() {
|
| 624 |
+
// Check if particles exist before trying to animate
|
| 625 |
+
if (particles.length === 0) return;
|
| 626 |
+
|
| 627 |
+
particles.forEach(particle => {
|
| 628 |
+
// Generate random target position within a reasonable range
|
| 629 |
+
// Adjust the multiplier (e.g., 200, 300) to control particle movement range
|
| 630 |
+
const x = (Math.random() - 0.5) * 200; // Random value between -100 and 100
|
| 631 |
+
const y = (Math.random() - 0.5) * 200; // Random value between -100 and 100
|
| 632 |
+
const duration = 15 + Math.random() * 15; // Random duration between 15s and 30s
|
| 633 |
+
|
| 634 |
+
// Apply the transition
|
| 635 |
+
particle.style.transition = `transform ${duration}s ease-in-out`;
|
| 636 |
+
particle.style.transform = `translate(${x}px, ${y}px)`;
|
| 637 |
+
});
|
| 638 |
+
|
| 639 |
+
// Schedule the next animation cycle
|
| 640 |
+
// Use a timeout slightly longer than the max animation duration
|
| 641 |
+
setTimeout(animateParticles, 30 * 1000); // Rerun animation every 30 seconds
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
|
| 645 |
+
|
| 646 |
+
// --- Event Listeners and Initial Calls ---
|
| 647 |
+
|
| 648 |
+
document.addEventListener('DOMContentLoaded', () => {
|
| 649 |
+
// Initialize current year in footer
|
| 650 |
+
if (currentYear) {
|
| 651 |
+
currentYear.textContent = new Date().getFullYear();
|
| 652 |
+
}
|
| 653 |
+
|
| 654 |
+
// Initial fetch and set up recurring fetch
|
| 655 |
+
fetchSettings(sheetCsvUrl);
|
| 656 |
+
setInterval(() => fetchSettings(sheetCsvUrl), fetchInterval);
|
| 657 |
+
|
| 658 |
+
// Admin modal functionality
|
| 659 |
+
adminBtn.addEventListener('click', () => {
|
| 660 |
+
adminModal.classList.add('active');
|
| 661 |
+
// Update the link in the modal just in case
|
| 662 |
+
if (editSheetLink) {
|
| 663 |
+
editSheetLink.href = googleSheetEditUrl;
|
| 664 |
+
}
|
| 665 |
+
});
|
| 666 |
+
|
| 667 |
+
closeModal.addEventListener('click', () => {
|
| 668 |
+
adminModal.classList.remove('active');
|
| 669 |
+
});
|
| 670 |
+
|
| 671 |
+
// Close modal if clicking outside content
|
| 672 |
+
adminModal.addEventListener('click', (e) => {
|
| 673 |
+
if (e.target === adminModal) {
|
| 674 |
+
adminModal.classList.remove('active');
|
| 675 |
+
}
|
| 676 |
+
});
|
| 677 |
+
|
| 678 |
+
// Add ripple effect to countdown digits
|
| 679 |
+
countdownDigits.forEach(digit => {
|
| 680 |
+
digit.addEventListener('click', createRipple);
|
| 681 |
+
});
|
| 682 |
+
|
| 683 |
+
// Start particle animation
|
| 684 |
+
animateParticles();
|
| 685 |
+
});
|
| 686 |
+
|
| 687 |
+
</script>
|
| 688 |
+
</body>
|
| 689 |
+
</html>
|