elmman/src/AnimationHelpers.elm

16 lines
347 B
Elm
Raw Normal View History

module AnimationHelpers exposing (..)
import Types exposing (Range)
calculateAnimation : Int -> Int -> Range -> Float
calculateAnimation current cycle range =
let
( start, end ) =
range
rangeDiff =
end - start
in
2017-06-25 05:06:23 +00:00
(toFloat (current % (cycle + 1))) / (toFloat (cycle)) * rangeDiff + start