How to make Houdini's Animation Worklet work?

246 Views Asked by At

I finally got around to do some scroll-bound animation with the Animation Worklet, just to find out that Surma's demo is not working. Not even the one in the article.

Is the API still behind a flag? Or did it change somehow?

1

There are 1 best solutions below

0
Kaiido On

Yes Houdini's Animation Worklet API (and most Houdini's Worklet APIs) is still behind the chrome://flags/#enable-experimental-web-platform-features flag.

if( !('animationWorklet' in CSS) ) {
  console.error('CSS Animation Worklet API is not supported in this browser, you may have to enable it from chrome://flags/#enable-experimental-web-platform-features');
}
else {
  console.log('good to go');
}