Skip to content

Commit

Permalink
Add a sin rectangle size animation
Browse files Browse the repository at this point in the history
  • Loading branch information
dgtized committed Feb 7, 2024
1 parent cf0b8fd commit 2497121
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/shimmers/sketches/display_tree.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,9 @@

(defn make-rect-growth [bounds]
(let [period (dr/rand-nth [2.0 4.0 6.0 8.0])
scale (if (dr/chance 0.5)
(fn [t] (mod (/ t period) 1.0))
(fn [t] (mod (/ (- t) period) 1.0)))]
scale (dr/weighted [[(fn [t] (mod (/ t period) 1.0)) 1]
[(fn [t] (mod (/ (- t) period) 1.0)) 1]
[(fn [t] (eq/unit-sin (/ t period))) 1]])]
(fn [p rotation t]
(-> bounds
(geometry/rotate-around p rotation)
Expand Down

0 comments on commit 2497121

Please sign in to comment.