mirror of
https://github.com/direct-img/vibegif.direct-img.link.git
synced 2026-10-29 03:34:51 +00:00
Each animation is its own file in gen/<subject>/<action>.js; npm run gen renders the missing ones to public/ as webp + gif. The homepage grid is now generated at build time by a small Vite plugin. First four: ghost/float, heart/beat, cloud/rain, coffee/steam. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1.2 KiB
JavaScript
23 lines
1.2 KiB
JavaScript
// happy coffee mug rocking a little while steam curls up out of it
|
|
const{sin,PI}=Math,T=2*PI
|
|
export const delay=90
|
|
export default(c,t)=>{
|
|
c.save();c.translate(119,214);c.rotate(.04*sin(t*T));c.translate(-119,-214)
|
|
for(const[w,s]of[[27,'#111'],[13,'#fff']])c.lineWidth=w,c.strokeStyle=s,c.beginPath(),c.arc(172,160,26,-PI/2,PI/2),c.stroke()
|
|
c.lineWidth=7;c.strokeStyle='#111'
|
|
c.beginPath();c.moveTo(66,120);c.lineTo(66,192);c.quadraticCurveTo(66,214,88,214);c.lineTo(150,214);c.quadraticCurveTo(172,214,172,192);c.lineTo(172,120)
|
|
c.ellipse(119,120,53,12,0,0,PI,true);c.fill();c.stroke()
|
|
c.beginPath();c.ellipse(119,120,53,12,0,0,T);c.fill();c.stroke()
|
|
c.fillStyle='#111';c.beginPath();c.ellipse(119,121,42,7,0,0,T);c.fill()
|
|
c.lineWidth=6
|
|
for(const x of[100,138])c.beginPath(),c.arc(x,166,8,PI*1.15,PI*1.85),c.stroke()
|
|
c.beginPath();c.arc(119,174,10,PI*.2,PI*.8);c.stroke()
|
|
c.restore()
|
|
for(const[x0,top,ph]of[[93,46,0],[119,30,.5],[145,46,1]])
|
|
for(const[w,s]of[[13,'#111'],[6,'#fff']]){
|
|
c.lineWidth=w;c.strokeStyle=s;c.beginPath()
|
|
for(let y=100;y>=top;y-=2)c.lineTo(x0+(2+5*(100-y)/70)*sin((100-y)/40*T-t*T+ph),y)
|
|
c.stroke()
|
|
}
|
|
}
|