Last active
October 13, 2015 03:47
Revisions
-
nodename revised this gist
Apr 4, 2013 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,9 @@ import Time (every) import Window (dimensions) firstImageIndex = 0 lastImageIndex = 1000 delta = lift inSeconds (fps 30) modCount signal period = lift (\a -> a `mod` period) (count signal) @@ -13,19 +12,20 @@ data PlayDirection = Fwd | Back yoyoIndex direction fwdIndex reverseIndex = if (direction == Fwd) then fwdIndex else reverseIndex yoyo signal period = let fwdIndices = modCount signal period reverseIndices = lift (\a -> period - a) fwdIndices turnarounds = keepIf (\a -> a == 0) false fwdIndices directions = (lift (\t -> if (t `mod` 2 == 0) then Fwd else Back) (count turnarounds)) in lift3 yoyoIndex directions fwdIndices reverseIndices showSlide (w,h) imageIndex = let filename = "morph/" ++ show imageIndex ++ ".svg" pic = image 800 800 filename textElement = text (Text.color white (toText $ show imageIndex)) in color black . container w h middle $ flow down [ container w (heightOf pic) middle pic, container w 100 midTop textElement ] showSlides first last interval = lift2 showSlide dimensions (lift (\a -> a + first) (yoyo (every interval) (last - first))) main = showSlides firstImageIndex lastImageIndex delta -
nodename revised this gist
Nov 24, 2012 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,8 +2,8 @@ import Mouse (clicks) import Time (every) import Window (dimensions) firstImageIndex = 0 - 500 lastImageIndex = 1500 imageInterval = 0.4 modCount signal period = lift (\a -> a `mod` period) (count signal) -
nodename created this gist
Nov 23, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ import Mouse (clicks) import Time (every) import Window (dimensions) firstImageIndex = 0 - 200 lastImageIndex = 1200 imageInterval = 0.4 modCount signal period = lift (\a -> a `mod` period) (count signal) data PlayDirection = Fwd | Back yoyoIndex direction fwdIndex reverseIndex = if (direction == Fwd) then fwdIndex else reverseIndex yoyo signal period = let { fwdIndices = modCount signal period ; reverseIndices = lift (\a -> period - a) fwdIndices ; turnarounds = keepIf (\a -> a == 0) false fwdIndices ; directions = (lift (\t -> if (t `mod` 2 == 0) then Fwd else Back) (count turnarounds)) } in lift3 yoyoIndex directions fwdIndices reverseIndices showSlide (w,h) imageIndex = let { filename = "morph/" ++ show imageIndex ++ ".svg" ; pic = image 800 800 filename ; textElement = text (Text.color white (toText $ show imageIndex)) } in color black . container w h middle $ flow down [ container w (heightOf pic) middle pic, container w 100 midTop textElement ] showSlides first last interval = lift2 showSlide dimensions (lift (\a -> a + first) (yoyo (every interval) (last - first))) main = showSlides firstImageIndex lastImageIndex imageInterval