in the deployed live version the initial video doesnt go away. it just stops.
Browse files
script.js
CHANGED
|
@@ -288,13 +288,23 @@ updateProgress() {
|
|
| 288 |
}, 50);
|
| 289 |
}
|
| 290 |
startWelcomeSequence() {
|
| 291 |
-
// Hide rabbit animation after
|
| 292 |
-
|
|
|
|
| 293 |
document.getElementById('rabbit-animation').style.display = 'none';
|
| 294 |
this.card.style.display = 'flex';
|
| 295 |
this.showWelcomeStep(0);
|
| 296 |
-
}
|
| 297 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 298 |
|
| 299 |
showWelcomeStep(stepIndex) {
|
| 300 |
this.currentStep = stepIndex;
|
|
@@ -339,13 +349,20 @@ showRabbitAnimation() {
|
|
| 339 |
|
| 340 |
rabbitAnim.style.display = 'flex';
|
| 341 |
video.play();
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
setTimeout(() => {
|
| 345 |
rabbitAnim.style.display = 'none';
|
| 346 |
video.currentTime = 0;
|
| 347 |
-
}
|
| 348 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 349 |
handleArrowRight() {
|
| 350 |
if (!this.started) this.startExperience();
|
| 351 |
else {
|
|
|
|
| 288 |
}, 50);
|
| 289 |
}
|
| 290 |
startWelcomeSequence() {
|
| 291 |
+
// Hide rabbit animation after video completes
|
| 292 |
+
const video = document.getElementById('rabbit-video');
|
| 293 |
+
video.addEventListener('ended', () => {
|
| 294 |
document.getElementById('rabbit-animation').style.display = 'none';
|
| 295 |
this.card.style.display = 'flex';
|
| 296 |
this.showWelcomeStep(0);
|
| 297 |
+
});
|
| 298 |
+
|
| 299 |
+
// Fallback in case video doesn't fire ended event
|
| 300 |
+
setTimeout(() => {
|
| 301 |
+
if (document.getElementById('rabbit-animation').style.display !== 'none') {
|
| 302 |
+
document.getElementById('rabbit-animation').style.display = 'none';
|
| 303 |
+
this.card.style.display = 'flex';
|
| 304 |
+
this.showWelcomeStep(0);
|
| 305 |
+
}
|
| 306 |
+
}, 5000);
|
| 307 |
+
}
|
| 308 |
|
| 309 |
showWelcomeStep(stepIndex) {
|
| 310 |
this.currentStep = stepIndex;
|
|
|
|
| 349 |
|
| 350 |
rabbitAnim.style.display = 'flex';
|
| 351 |
video.play();
|
| 352 |
+
// Remove the animation after video completes
|
| 353 |
+
video.addEventListener('ended', () => {
|
|
|
|
| 354 |
rabbitAnim.style.display = 'none';
|
| 355 |
video.currentTime = 0;
|
| 356 |
+
});
|
| 357 |
+
|
| 358 |
+
// Fallback timeout in case video doesn't fire ended event
|
| 359 |
+
setTimeout(() => {
|
| 360 |
+
if (rabbitAnim.style.display !== 'none') {
|
| 361 |
+
rabbitAnim.style.display = 'none';
|
| 362 |
+
video.currentTime = 0;
|
| 363 |
+
}
|
| 364 |
+
}, 3000);
|
| 365 |
+
}
|
| 366 |
handleArrowRight() {
|
| 367 |
if (!this.started) this.startExperience();
|
| 368 |
else {
|