-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rotozoom.elm
31 lines (28 loc) · 951 Bytes
/
Rotozoom.elm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module Rotozoom(rotozoom, main) where
import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
import Time exposing (..)
import Random exposing (..)
import Basics exposing (..)
import Window
main =
Signal.map3 rotozoom Window.width Window.height (Signal.foldp (+) 0 (fps 30))
rotozoom w h t =
if t < 10000 then
collage w h
[ tiledImage (w * 5) (h * 5) "chilicorn.png"
|> toForm
|> scale (1.33 + cos(10))
|> alpha (t/5000)
|> rotate (degrees ((sin(10) * 100) + (cos(5)) * 150))
|> move ((sin(t/1000) * 150), (sin(10) * 150))
]
else
collage w h
[ tiledImage (w * 5) (h * 5) "chilicorn.png"
|> toForm
|> scale(1.33 + cos(t/1000))
|> rotate (degrees ((sin(t/1000) * 100) + (cos(t/2000)) * 150))
|> move ((sin(t/1000) * 150), (sin(t/1000) * 150))
]