I made this Bauble dweet as a Christmas themed exercise in 2020 <a href="https://www.dwitter.net/d/20993" rel="nofollow">https://www.dwitter.net/d/20993</a><p><pre><code> function u(t) {
t||(c.width/=6) // shrink canvas to 1/6 at t==0
M=a=>x.filter=a?"none":"blur(1px)brightness(90%"
M();x.drawImage(c,0,0)
for(i=n=90;--i;)
x.fillRect(
160-S(X=i+t*4)*(1-(v=C(i*n))*v)*n,
v*n+n,
4,
2,
x.fillStyle="#F"+(i+10),M(C(X)<0))
}
</code></pre>
with
u(t) is called 60 times per second.
t: elapsed time in seconds.
c: A 1920x1080 canvas.
x: A 2D context for that canvas.
S: Math.sin
C: Math.cos