Re: [csswg-drafts] [web-animations-2] Idea: Custom Effects

_From @Martin-Pitt on August 2, 2016 21:16_

Any particular reason why the API can't be like this instead?

``` javascript
var node = new JavaScriptEffect(function(timeFraction) {
  // When animating, timeFraction is from 0.0 to 1.0
  // When null, WAAPI is telling us to 'cleanup', e.g. fill: 'none' = unset element style for example when animation is complete
}, timingOptions);

var animation = new Animation(node, document.timeline);
animation.play();
```

I always felt this was a clean and direct way to go about things, kind of like a Promise. It makes no assumptions. You could be rendering to the Web Audio API or via Web Bluetooth to some custom hardware – animate the world!


-- 
GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2062#issuecomment-349193907 using your GitHub account

Received on Tuesday, 5 December 2017 04:43:28 UTC