Skip to content

Commit 927b0d8

Browse files
committed
Blue pill click: no shatter video, only red pill triggers explosion
1 parent 7725732 commit 927b0d8

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

docs/index.html

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,14 +153,16 @@
153153
}
154154
splitAnim();
155155

156-
// Switch hero video to shatter with crossfade
157-
const vCalm=document.getElementById('vid-hero-calm');
158-
const vShatter=document.getElementById('vid-hero-shatter');
159-
if(vCalm&&vShatter){
160-
vShatter.currentTime=2.5; // skip to the explosion part
161-
vShatter.play().catch(()=>{});
162-
vShatter.style.opacity='1';
163-
vCalm.style.opacity='0';
156+
// Only red pill triggers shatter video
157+
if(type==='red'){
158+
const vCalm=document.getElementById('vid-hero-calm');
159+
const vShatter=document.getElementById('vid-hero-shatter');
160+
if(vCalm&&vShatter){
161+
vShatter.currentTime=2.5;
162+
vShatter.play().catch(()=>{});
163+
vShatter.style.opacity='1';
164+
vCalm.style.opacity='0';
165+
}
164166
}
165167

166168
const flash=document.getElementById('pill-flash');

mofa-website/src/pages/index.astro

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -525,14 +525,16 @@ let cx=0,cy=0;
525525
}
526526
splitAnim();
527527

528-
// Switch hero video to shatter with crossfade
529-
const vCalm=document.getElementById('vid-hero-calm');
530-
const vShatter=document.getElementById('vid-hero-shatter');
531-
if(vCalm&&vShatter){
532-
vShatter.currentTime=2.5; // skip to the explosion part
533-
vShatter.play().catch(()=>{});
534-
vShatter.style.opacity='1';
535-
vCalm.style.opacity='0';
528+
// Only red pill triggers shatter video
529+
if(type==='red'){
530+
const vCalm=document.getElementById('vid-hero-calm');
531+
const vShatter=document.getElementById('vid-hero-shatter');
532+
if(vCalm&&vShatter){
533+
vShatter.currentTime=2.5;
534+
vShatter.play().catch(()=>{});
535+
vShatter.style.opacity='1';
536+
vCalm.style.opacity='0';
537+
}
536538
}
537539

538540
const flash=document.getElementById('pill-flash');

0 commit comments

Comments
 (0)