John2121 commited on
Commit
8433b75
·
verified ·
1 Parent(s): f867d2b

in the deployed live version the initial video doesnt go away. it just stops.

Browse files
Files changed (1) hide show
  1. script.js +26 -9
script.js CHANGED
@@ -288,13 +288,23 @@ updateProgress() {
288
  }, 50);
289
  }
290
  startWelcomeSequence() {
291
- // Hide rabbit animation after 3 seconds
292
- setTimeout(() => {
 
293
  document.getElementById('rabbit-animation').style.display = 'none';
294
  this.card.style.display = 'flex';
295
  this.showWelcomeStep(0);
296
- }, 3000);
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
- // Remove the animation after it completes - extended duration
344
- setTimeout(() => {
345
  rabbitAnim.style.display = 'none';
346
  video.currentTime = 0;
347
- }, 2500); // Extended from 1000ms to 2500ms
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 {