A timeline-based animation engine for Elm
Go to file
2024-08-05 10:36:48 -04:00
benchmarks More renaming 2023-08-06 20:11:14 -04:00
examples Update new examples 2024-05-03 16:43:57 -04:00
notes More renaming 2023-08-06 20:11:14 -04:00
review Remove some elm-review rules 2024-05-04 07:59:39 -04:00
src Simplify foldpAll and fix Timeline.previous 2024-08-05 10:36:02 -04:00
tests Add more tests for Timeline.arrived 2024-08-05 10:36:48 -04:00
.gitignore Upgrade elm-test 2024-04-09 09:52:40 -04:00
changelog.md Animator v1.1.0 - Better introspection of Timelines, including upcoming, and arrived 2020-05-29 09:57:51 -04:00
docs.json Set initial properties if the first keyframe is a "set" (e.g. zero duration) 2024-04-27 11:58:25 -04:00
elm.json Remove Animator.Watcher from the exposed list 2024-05-04 08:00:14 -04:00
LICENSE Initial commit 2019-11-01 19:21:41 -04:00
package.json Add elm-review (again) 2024-04-09 09:52:24 -04:00
pnpm-lock.yaml Add elm-review (again) 2024-04-09 09:52:24 -04:00
README.md remove old examples from readme 2021-10-01 10:19:14 -04:00

Elm Animator

Bring animations to your Elm app!

Check out the talk that goes with the library, The Immutable Animator's Toolkit.

Join the #animations channel on the Elm Slack if you want to chat!


     import Animator as Anim
     import Html


     Anim.div
        (Anim.transition (Anim.ms 200)
            [ Anim.opacity <|
                if model.visible then
                    1
                else
                    0
            ]
        )
        []
        [ text "👍" ]

The Goal of a Continuous UI

Animation can either be a nuanced, playful helper in your UI, or it can be a nuisance.

There's an immediate question of what kinds of animation we want to cultivate in the Elm community.

With that in mind, here are two types of animation that I'd love to emphasize and elm-animator should be very useful for both.

Continuous UI

A continuous UI minimizes context-shifting for a user and allows them to build a spatial model of your interface.

We're generally used to pieces of UI popping in and out of existence, and pages that change drastically on click. Everytime something changes, it's a context shift for your user.

We can use animation to make that experience continuous so our users can build a quick intuition about how our interfaces work.

Sarah Drasner has an excellent talk showing what a continuous UI interaction can look like.

There's also a fairly basic page transition example - (Code) for this library that has the same principle.

Calm Enrichment

The second type is something I think of as calm enrichment.

The floating city on the Elm Japan Website —you will need to scroll down a little— is wonderful!

It doesn't distract from what I'm trying to accomplish on the website, it simply sits there, calmly floating. It doesn't take anything away from my budget of attention that I have when visiting the website. In fact it likely increases the amount of attention I'm willing to pay.

They used elm-playground —which I am likewise inspired by— to achieve the effect and convinced me to make this sort of thing easy in elm-animator.