@@ -26,6 +26,8 @@ import {rand} from "../internal/rand";
2626import { genFromOptions } from "../internal/gen" ;
2727import { BlobOptions } from "../public/blobs" ;
2828import { interpolateBetween , interpolateBetweenSmooth } from "../internal/animate/interpolate" ;
29+ import { divide } from "../internal/animate/prepare" ;
30+ import blobs from "../public/legacy" ;
2931
3032const makePoly = ( pointCount : number , radius : number , center : Coord ) : Point [ ] => {
3133 const angle = ( 2 * Math . PI ) / pointCount ;
@@ -578,5 +580,42 @@ addCanvas(
578580 ) ;
579581 } ) ;
580582 } ,
581- ( ) => { } ,
583+ ( ctx , width , height , animate ) => {
584+ const period = ( Math . PI + Math . E ) * 1000 ;
585+ const center : Coord = { x : width * 0.5 , y : height * 0.5 } ;
586+ const maxExtraPoints = 4 ;
587+ const { pt} = sizes ( ) ;
588+
589+ const blob = centeredBlob (
590+ {
591+ extraPoints : 0 ,
592+ randomness : 6 ,
593+ seed : "flip" ,
594+ size : height * 0.9 ,
595+ } ,
596+ center ,
597+ ) ;
598+
599+ animate ( ( frameTime ) => {
600+ const percentage = mod ( frameTime , period ) / period ;
601+ const extraPoints = Math . floor ( percentage * ( maxExtraPoints + 1 ) ) ;
602+ drawClosed ( ctx , divide ( extraPoints + blob . length , blob ) , true ) ;
603+
604+ forPoints ( blob , ( { curr} ) => {
605+ ctx . beginPath ( ) ;
606+ ctx . arc ( curr . x , curr . y , pt * 6 , 0 , 2 * Math . PI ) ;
607+
608+ tempStyles (
609+ ctx ,
610+ ( ) => {
611+ ctx . strokeStyle = colors . secondary ;
612+ ctx . lineWidth = pt ;
613+ } ,
614+ ( ) => {
615+ ctx . stroke ( ) ;
616+ } ,
617+ ) ;
618+ } ) ;
619+ } ) ;
620+ } ,
582621) ;
0 commit comments