Giter Site home page Giter Site logo

Comments (4)

rolojf avatar rolojf commented on June 12, 2024 1

Sure, this weekend I hope to have it ready.

from elm-simple-animation.

andrewMacmurray avatar andrewMacmurray commented on June 12, 2024

Hi Rolando, that's awesome! I wonder if we could add a built in helper to the Animated module that wraps what you've done above:

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
        }

from elm-simple-animation.

rolojf avatar rolojf commented on June 12, 2024

Yes!, I think I would be a great addition to the package.
Just some thoughts:
Maybe it's a good idea to think again if the class is needed at all.
I understand that with other implementations, the css it's linked to the class of this node.
But in elm-css all the style added is directly through an inline style element.
Therefore, maybe it is not needed. All additional styling is already provided with other tailwind classes.
or ¿am i missing something? Hope I explained myself (not native English speaker)

from elm-simple-animation.

andrewMacmurray avatar andrewMacmurray commented on June 12, 2024

Great!

I'm not super familiar with the internals of elm-css so it's definitely worth a try - the stylesheet Animated.custom returns expects there to be a dom node with a specific class name so a keyframes animation can be applied:

@keyframes anim-1000infinite-y-0-y-5 {
   0% { transform: translateY(0px) }
   100% { transform: translateY(5px) }
}

.anim-1000infinite-y-0-y-5 {
   animation-name: anim-1000infinite-y-0-y-5;
   animation-iteration-count: infinite;
   animation-duration: 1000ms;
}

Happy for you to make a PR if you have time?

from elm-simple-animation.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.