Skip to content

Commit

Permalink
added muzax element, renamed startfield to Starfield
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuukkan committed Apr 1, 2016
1 parent b81449c commit 87e3d6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
File renamed without changes.
14 changes: 10 additions & 4 deletions demo1.elm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import Plasma exposing (..)
import Hypnocorn exposing (..)
import Rotozoom exposing (..)
import Starfield
import Html exposing (..)
import Html.Attributes exposing (..)


type Effect = Cornfield | Rotozoom | Hypnocorn | Plasma | Starfield | Chilicorn
Expand All @@ -19,6 +21,10 @@ type alias State =
, stars: Starfield.Stars
}

muzak : Html
muzak =
Html.audio [ src "muzak.mp3", preload "true", autoplay True ] []

initialState : State
initialState =
{ effect = Chilicorn
Expand All @@ -27,13 +33,13 @@ initialState =
}

updateState : Float -> State -> State
updateState time state =
updateState time state =
let
effect = selectEffectTime (time / 1000)
in
{ state |
effect = effect,
time = time
time = time
}

selectEffectTime : Float -> Effect
Expand All @@ -50,7 +56,7 @@ selectEffectTime t =
Plasma
else
Chilicorn


main : Signal Element
main =
Expand Down Expand Up @@ -79,4 +85,4 @@ chilicorn w h t =
|> toForm
|> scale (0.33)
|> alpha (1.05 - sin(t/1000))
]
]

0 comments on commit 87e3d6c

Please sign in to comment.