2013-02-08 17:13:34 +00:00
|
|
|
title w = size w 60 . text . header . toText $ "Elm-Happstack"
|
2012-05-29 21:47:31 +00:00
|
|
|
|
2012-06-27 06:52:07 +00:00
|
|
|
lightGrey = rgb 240 241 244
|
|
|
|
mediumGrey = rgb 216 221 225
|
2012-05-29 21:47:31 +00:00
|
|
|
heading outer inner =
|
2013-02-08 17:07:44 +00:00
|
|
|
color mediumGrey . size outer 61 .
|
|
|
|
color lightGrey . size outer 60 .
|
|
|
|
size inner 60 $ title inner
|
2012-05-29 21:47:31 +00:00
|
|
|
|
|
|
|
skeleton body outer =
|
|
|
|
let inner = if outer < 820 then outer - 20 else 800 in
|
|
|
|
flow down [ heading outer inner
|
|
|
|
, body outer inner
|
|
|
|
]
|
|
|
|
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
section = text . bold . Text.height (5/4) . toText
|
|
|
|
|
2013-02-08 17:07:44 +00:00
|
|
|
-- splicing of values works but literal substitution of strings
|
|
|
|
-- for this reason, we need to have quotes.
|
|
|
|
mouseLink = "#{mouse}"
|
|
|
|
clockLink = "#{clock}"
|
|
|
|
shapesLink = "#{shapes}"
|
|
|
|
|
|
|
|
|
2012-05-29 21:47:31 +00:00
|
|
|
info w = List.map (\f -> f ()) . List.intersperse (\x -> plainText " ") . List.map ((\e x -> e) . width w) $
|
2013-02-08 17:13:34 +00:00
|
|
|
[ section "Written in Elm, served with Happstack"
|
2013-02-07 15:35:14 +00:00
|
|
|
, text $ toText "This page is written in " ++ Text.link "http://elm-lang.org/" (toText "Elm") ++
|
2012-05-29 21:47:31 +00:00
|
|
|
toText " and served using the " ++
|
2013-02-08 17:13:34 +00:00
|
|
|
Text.link "http://happstack.com/" (toText "Happstack Web Framework") ++
|
2012-05-29 21:47:31 +00:00
|
|
|
toText ". Since you are looking at this page it is safe to assume that you already have the example code. "
|
2013-02-08 17:13:34 +00:00
|
|
|
, text $ toText "URLs are rendered using simple QuasiQuoter variable interpolation."
|
2012-05-29 21:47:31 +00:00
|
|
|
, section "More examples:"
|
2013-02-08 17:07:44 +00:00
|
|
|
, text $ toText "- " ++ Text.link mouseLink (toText "A simple mouse input example")
|
|
|
|
, text $ toText "- " ++ Text.link clockLink (toText "An animated analog clock")
|
|
|
|
, text $ toText "- " ++ Text.link shapesLink (toText "Some simple rendered shapes")
|
2012-05-29 21:47:31 +00:00
|
|
|
]
|
|
|
|
|
2013-02-08 17:07:44 +00:00
|
|
|
-- The following line does not parse, replaced it something slightly different
|
|
|
|
-- body outer inner = width outer . flow down $ (:) (plainText " ") $ info inner
|
|
|
|
body outer inner = width outer . flow down $ info inner
|
2012-05-29 21:47:31 +00:00
|
|
|
|
|
|
|
main = lift (skeleton body) Window.width
|