 (ns solar-system-of-js.core
+
   (:require-macros
     [cljs.core.async.macros :refer [go go-loop]])
   (:require

               :font-alpha 0}
   :static {:title {:alpha 0}
            :sphere {:alpha 0
                     :r 200}
            :typescript {:alpha 0}
            :soundscript {:alpha 0}
            :flow {:alpha 0}}

        (<! (multi-animate!
              {:a :_ :b 1 :duration 1} [:static :title :alpha]
              {:a :_ :b 1 :duration 1} [:static :sphere :alpha]
              {:a :_ :b 400 :duration 1} [:static :sphere :r])))

     (let [angle (/ (* 2 PI) 3)]
       [;; show typescript
        #(go
           (<! (multi-animate!
                 {:a :_ :b 300 :duration 1} [:cam :x]
                 {:a :_ :b 1 :duration 1} [:static :typescript :alpha]
                 {:a :_ :b angle :duration 1} [:static :sphere :angle]
                 )))

        ;; show flow
        #(go
           (<! (multi-animate!
                 {:a :_ :b 1 :duration 1} [:static :flow :alpha]
                 {:a :_ :b 0.5 :duration 1} [:static :typescript :alpha]
                 {:a :_ :b (* 2 angle) :duration 1} [:static :sphere :angle]
                 )))

        ;; show soundscript
        #(go
           (<! (multi-animate!
                 {:a :_ :b 0.5 :duration 1} [:static :flow :alpha]
                 {:a :_ :b 1 :duration 1} [:static :soundscript :alpha]
                 {:a :_ :b (* 3 angle) :duration 1} [:static :sphere :angle]
                 )))])

     ])))

