-
Notifications
You must be signed in to change notification settings - Fork 143
Proposal, custom script based transitions #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi vidhill, It’s true that the current CompositorWorker API does not allow you to assign behaviors via CSS, and your proposal certainly does make this possible. The customization of transitions is interesting, in particular. That said, our current API is just a stand-in and we intend to change the API to be more Houdini-like in the near future. I’d presented sketches of what this might look like last year, and some have similarities to your proposal. But even this is still a work in progress -- we’re hoping make our first concrete API proposal shortly. In addition to the single element property animation that your approach permits, with our upcoming AnimationWorklet proposal we will be trying to address a bit of a wider variety of use cases:
|
Just wanted to mention that I do like the idea a lot, but agree with Ian and Shans that we will have to land the fundamentals first before adding exciting features like this. Once we have a compositor-worker and a layout-worker, so many stuff will become possible for a very small cost to implementers... |
The Animation Worklet Proposal, likely crosses over/goes further that what I proposed here.. |
I think I agree with you, that spec would enable you to do just that. |
I would suppose so |
Hello,
Might be cross-posting here, as I sent this to the mailing list too,
But I find the mailing lists awkward to keep track of..
I think this sits in an odd position in between Houdini and Web Animation API, I have also posted this there ( w3c/web-animations#161 )
I have attempted to make my example as 'Houdini consistent' as possible, but I haven't delved deeply into the spec so excuse me if I miss some conventions.
I believe this would sit somewhere near the Compositor Worker, perhaps as a variation/extension on top of the Compositor Worker
Following discussion in w3c/csswg-drafts#229 I put some thought into programmatic transitions, like Apple's spring proposal.
I've been thinking about the notion that we could facilitate custom scripted animation for transition values.
I think this sits in an odd position in between Houdini and Web Animation, I may post this on both.
I believe this would sit somewhere near the Compositor Worker, perhaps as a variation/extension on top of the Compositor Worker
Here is the proposition I have arrived at..
I have attempted to make my example as 'Houdini consistent' as possible, but I haven't delved deeply into is so excuse me if I miss some conventions.
I am using Apple's spring transition proposal as an example of a complex use case.
The css function syntax is similar to paint and layout in the Houdini spec e.g.
background: paint(foo)
but would allow the facility to pass options, hence the second set of parentheses.Anyway, css would look something like this
Simple example of an ease function file
File: simple.js
Example of how something more complex, e.g. Apple's bounce transition effect could be defined using this method
File: bounce.js
The browser would know up front about the function and could, I assume be prepared,
Different variations of the spring, for example could be achieved by passing different values into the init function, which could be done from the CSS, no need to touch the js.
A designer unfamiliar with javascript could tweak the animation from CSS only.
Obviously some code savvy people could share their functions with the community, and feasibly come up with some very clever stuff. And it would not need to go through the standards process, in the spirit of the Houdini project
The frame function would at maximum be executed every frame,
But of course the browser could decide to drop/skip frames if it needed,
The browser itself could work out how much rounding would happen.
The scope of what the script could would be extremely limited..
As the only thing the script could do is return a value 0-1 obviously overshooting 1 if the ease necessitated
The text was updated successfully, but these errors were encountered: