aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/reading/component/widget/Transition.scala
blob: aa8ff3d3ed123e5583f7bca1ddaa56dd9163028a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package reading.component.widget

object Transition {
  def linear(progress: Double, total: Double): Double =
    progress / total

  def easeIn(progress: Double, total: Double): Double =
    math.pow(progress, 2) / math.pow(total, 2)

  def easeOut(progress: Double, total: Double): Double =
    (-1) * (progress / total) * (progress / total - 2)
}