andrewMacmurray / elm-simple-animation

stateless animation utils for Elm
https://package.elm-lang.org/packages/andrewMacmurray/elm-simple-animation/latest/
MIT License
50 stars 3 forks source link

Add Elm CSS adaptor #24

Closed andrewMacmurray closed 2 years ago

andrewMacmurray commented 2 years ago

Have been meaning to do this for ages! Adding an Animated.elmCss helper would cover a lot of the common Html packages elm folks use.

A lot of the thought has been done in #20, so ideally the helper would look something like this:

import Html.Styled as Htmls
import Html.Styled.Attributes as Attr
import Simple.Animation exposing (Animation)
import Simple.Animation.Animated as Animated

animatedStyleNode :
    (List (Htmls.Attribute msg) -> List (Htmls.Html msg) -> Htmls.Html msg)
    -> Animation
    -> List (Htmls.Attribute msg)
    -> List (Htmls.Html msg)
    -> Htmls.Html msg
animatedStyleNode =
    Animated.elmCss
        { text = Htmls.text
        , node = Htmls.node
        , class = Attr.class
        }