Added "animate" binding, fixes #70
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
;
|
||||
(clear)
|
||||
;
|
||||
(def seg-count 50)
|
||||
;
|
||||
(def frame-middle
|
||||
@@ -47,4 +44,9 @@
|
||||
(frame) :w) 0)
|
||||
("rgba(255,255,255,0)" "white" "#72dec2" "red")))))
|
||||
;
|
||||
(times seg-count draw-dash)
|
||||
(defn redraw
|
||||
()
|
||||
(
|
||||
(clear)
|
||||
(times seg-count draw-dash)))
|
||||
(on "animate" redraw)
|
||||
@@ -1,14 +0,0 @@
|
||||
; filesystem
|
||||
|
||||
; print path
|
||||
(echo
|
||||
(filepath))
|
||||
; print folder path
|
||||
(echo
|
||||
(dirpath))
|
||||
; print file content
|
||||
(echo
|
||||
(file))
|
||||
; print folder content
|
||||
(echo
|
||||
(dir))
|
||||
@@ -56,4 +56,13 @@
|
||||
|
||||
; Interop
|
||||
(test "interop" ((of (of (js) "Math") "max") 2 4) 4)
|
||||
(test "recursive key selector" ((of (js) "Math" "max") 2 4) 4)
|
||||
(test "recursive key selector" ((of (js) "Math" "max") 2 4) 4)
|
||||
|
||||
; fs
|
||||
|
||||
; filesystem
|
||||
|
||||
(echo (filepath))
|
||||
(echo (dirpath))
|
||||
(echo (file))
|
||||
(echo (dir))
|
||||
@@ -1 +0,0 @@
|
||||
(echo (map '(add %1 2) (4 5 6))
|
||||
@@ -12,4 +12,6 @@
|
||||
(echo (values ob))
|
||||
|
||||
(set ob :a 4)
|
||||
(echo (of ob :a))
|
||||
(echo (of ob :a))
|
||||
|
||||
(echo (map '(add %1 2) (4 5 6))
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
;
|
||||
(def ring
|
||||
(circle 300 300 150))
|
||||
;
|
||||
(defn redraw
|
||||
()
|
||||
(
|
||||
(clear)
|
||||
(stroke ring 2 "red")))
|
||||
;
|
||||
(defn on-msg
|
||||
(msg)
|
||||
(
|
||||
(clear)
|
||||
(def msg-value
|
||||
(of
|
||||
(first msg) :value))
|
||||
(stroke
|
||||
(circle 300 300 150) 2
|
||||
(if
|
||||
(eq msg-value 1) "#ffb545" "#72dec2" ))))
|
||||
(set ring :r 150)))
|
||||
; frame
|
||||
(set ring :r
|
||||
(sub
|
||||
(of ring :r) 1))
|
||||
(redraw)
|
||||
; trigger
|
||||
(on "/a" on-msg)
|
||||
Reference in New Issue
Block a user