8000 Animation CPart · Issue #49 · modulojs/modulo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Animation CPart #49

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

Open
michaelpb opened this issue Apr 20, 2023 · 0 comments
Open

Animation CPart #49

michaelpb opened this issue Apr 20, 2023 · 0 comments

Comments

@michaelpb
Copy link
Contributor

The "Animation" CPart would expose the Web Animations API in CPart format:

https://developer.mozilla.org/en-US/docs/Web/API/Web_Animations_API

Also, importantly, some way to bind to a value, so there doesn't have to be a rerender, but there can be "bound" animations to state values.

Something like:

<Component>
    <Template>
       <div [animation.animate]></div>
       <button @click:=animation.play>Play!</button>
    </Template>
    <Animation duration:=1000 iterations:=3>
        {% frame %}
            transform: translate(0, 0)
        {% endframe %}
    </Animation>
    <Style> div { color :blue; }</Style>
</Component>

Probably best as a recipe, though if the implementation is simple + useful enough, maybe an included CPart

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0