This is an alternative site for discovering Elm packages. You may be looking for the official Elm package site instead.
A simple transition library for Elm
version 1.0.0
license BSD3
native-modules False
elm-version 0.15.1 <= v < 0.16.0
Tag 1.0.0
Committed At 2015-08-13 10:49:22 UTC
evancz/elm-html 4.0.1 <= v < 5.0.0 4.0.2
evancz/elm-effects 1.0.0 <= v < 2.0.0 1.0.0
elm-lang/core 2.1.0 <= v < 3.0.0 2.1.0

Modules

README

elm-transition

A simple transition library for Elm

Usage

Just follow the Elm Architecture.

type Action = TransitionAction Transition.Action

type alias Model = Transition.Model

init : (Model, Effects Action)
init = (Transition.init, Effects.none)

update : Action -> Model -> (Model, Effects Action)
update action model =
  case action of
    TransitionAction action ->
      let
        (newModel, effects) =
          Transition.update action model
      in
        (newModel, Effects.map TransitionAction effects)

view : Address Action -> Model -> Html
view address model =
  button
    [ onClick
        (forwardTo address TransitionAction)
        (Transition.toggle 1.0) -- type(start, reverse, toggle) and duration(sec)
    ]
    [ model.ratio -- from start(0.0) to end(1.0)
        |> toString
        |> text
    ]