Meneman commited on
Commit
92cddb4
·
verified ·
1 Parent(s): 417c40d

undefined - Follow Up Deployment

Browse files
Files changed (1) hide show
  1. index.html +3 -1
index.html CHANGED
@@ -107,7 +107,9 @@ if($p.src!==v.url){$p.src=v.url;$p.load();}
107
  $p.currentTime=pos;$p.loop=true;$p.play().catch(()=>{$p.muted=true;$p.play();});$t.textContent=v.title;$m.textContent="Duration: "+secFmt(v.duration);
108
  $rows.forEach((r,j)=>{r.classList.toggle("active",j===i)});const ms=((v.end-h+24)%24)*3600*1000;setTimeout(playVid,ms);}
109
  playVid();
110
- // bubbles
 
 
111
  function bubble(){const b=document.createElement("div");const s=20+Math.random()*60;b.className="bubble";b.style.width=`${s}px`;b.style.height=`${s}px`;b.style.left=`${Math.random()*100}vw`;b.style.animationDuration=`${15+Math.random()*20}s`;document.getElementById("bubbles").appendChild(b);setTimeout(()=>b.remove(),40000);}
112
  setInterval(bubble,1000);
113
  // fake viewers
 
107
  $p.currentTime=pos;$p.loop=true;$p.play().catch(()=>{$p.muted=true;$p.play();});$t.textContent=v.title;$m.textContent="Duration: "+secFmt(v.duration);
108
  $rows.forEach((r,j)=>{r.classList.toggle("active",j===i)});const ms=((v.end-h+24)%24)*3600*1000;setTimeout(playVid,ms);}
109
  playVid();
110
+ // detect aspect ratio
111
+ $p.addEventListener("loadedmetadata",()=>{const r=$p.videoWidth/$p.videoHeight;if(r<1){$p.style.objectFit="contain";$p.style.background="#000";}else{$p.style.objectFit="cover";}});
112
+ // bubbles
113
  function bubble(){const b=document.createElement("div");const s=20+Math.random()*60;b.className="bubble";b.style.width=`${s}px`;b.style.height=`${s}px`;b.style.left=`${Math.random()*100}vw`;b.style.animationDuration=`${15+Math.random()*20}s`;document.getElementById("bubbles").appendChild(b);setTimeout(()=>b.remove(),40000);}
114
  setInterval(bubble,1000);
115
  // fake viewers