Draw the minimalist creatures white directly and drop invert

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-23 14:21:01 +00:00
co-authored by Claude Opus 5.5
parent b9200e390f
commit f25e39b727
13 changed files with 18 additions and 22 deletions
+3 -3
View File
@@ -1,9 +1,9 @@
// praying mantis: it sways, tilts its triangle head side to side, and gives its folded forearms a little pump
const{sin,cos,PI,max}=Math,T=2*PI
export const frames=24,delay=85,rim=3,invert=true
export const frames=24,delay=85,rim=3,rimColor='#111'
export default(c,t)=>{
const s=sin(T*t),pm=t>.3&&t<.6?sin(PI*(t-.3)/.3):0,ht=.3*sin(T*t+1)
c.fillStyle=c.strokeStyle='#111';c.lineWidth=4
c.fillStyle=c.strokeStyle='#fff';c.lineWidth=4
const shape=f=>{c.beginPath();f();c.fill();c.stroke()}
for(const[hx,kx,ky,fx]of[[130,152,186,166],[118,98,190,82],[112,62,184,46]])c.beginPath(),c.moveTo(hx,160),c.lineTo(kx,ky),c.lineTo(fx,212),c.stroke()
c.translate(122,212);c.rotate(.03*s);c.translate(-122,-212)
@@ -17,6 +17,6 @@ export default(c,t)=>{
c.save();c.translate(152,80);c.rotate(ht)
c.lineWidth=3;for(const d of[-1,1])c.beginPath(),c.moveTo(d*6,-16),c.quadraticCurveTo(d*12,-48,d*30,-64),c.stroke()
c.lineWidth=6;shape(()=>{c.moveTo(-20,-16);c.lineTo(20,-16);c.lineTo(0,10);c.closePath()})
c.fillStyle='#fff';for(const d of[-1,1])c.beginPath(),c.arc(d*15,-15,3.5,0,T),c.fill()
c.fillStyle='#111';for(const d of[-1,1])c.beginPath(),c.arc(d*15,-15,3.5,0,T),c.fill()
c.restore()
}