Created
July 26, 2014 14:04
-
-
Save ljsc/272c482c0a55d119ca07 to your computer and use it in GitHub Desktop.
This file contains 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 characters
import Html as H | |
import Html ((:=)) | |
intercalate : String -> [String] -> String | |
intercalate s ss = concat (intersperse s ss) | |
shadow : Float -> Float -> Float -> Float -> Float -> Float -> String | |
shadow x y b h s l = intercalate " " [H.px x , H.px y, H.px b] ++ " " ++ H.color (hsl h s l) | |
greeting : Float -> Element | |
greeting t = let theta = t * (2 * pi) / 3.0 | |
in container 500 500 middle | |
<| H.toElement 200 200 | |
<| H.node "div" [] | |
[ "color" := H.color (hsl theta 0.75 0.80) | |
, "font-size" := H.px 60 | |
, "text-shadow" := intercalate ", " [ shadow 2 2 8 theta 0.85 0.2 | |
, shadow 0 0 35 theta 0.95 0.1 | |
] | |
] | |
[H.text "Hello Rainbow"] | |
frameCount : Signal Float | |
frameCount = let sceneFps = 25 in (sampleOn (fps sceneFps) (constant (1.0/sceneFps))) | |
main : Signal Element | |
main = greeting <~ foldp (+) 0 frameCount |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment