timothypratley / reanimated

An animation library for Reagent (ClojureScript)
250 stars 14 forks source link

spring options not working? #13

Closed jraines closed 7 years ago

jraines commented 7 years ago

Hi, I have been trying to tweak the bounciness of a spring animated component, and it seems like :velocity is the only option that makes a visible difference. Changing my :mass, :stiffness, and :damping values by several orders of magnitude does nothing that I can discern. My code:

(def top (reagent/atom -400))
(def spring (anim/spring top {:velocity 10
                                                 :mass 1000
                                                 :stiffness 10.0
                                                 :damping 1.0}))

(defn show
  [_]
  (reset! top 200))

(defn container
  [{{shown :shown?} :modals}]
  (println @spring)
  [:div.modal {:style {:top @spring}}
   "HIIIIIII"])