Skip to content

Animation CPart #49

Open
Open
@michaelpb

Description

@michaelpb

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions