aboutsummaryrefslogtreecommitdiff
path: root/src/View/Page.elm
diff options
context:
space:
mode:
authorJoris Guyonvarch2015-03-07 18:46:47 +0100
committerJoris Guyonvarch2015-03-07 18:46:47 +0100
commit6c1f5e10631a3f66f4c85a45b6f28ffd366105c5 (patch)
tree624d833aa62ad8ce5ed172144ff69a2846d55154 /src/View/Page.elm
parentae14beca0452b59ead64b8cdd6544824d59a55dc (diff)
Show best score in html layout
Diffstat (limited to 'src/View/Page.elm')
-rw-r--r--src/View/Page.elm11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/View/Page.elm b/src/View/Page.elm
index 6d6c54d..4dd54b5 100644
--- a/src/View/Page.elm
+++ b/src/View/Page.elm
@@ -20,13 +20,22 @@ pageView game =
[ h1 [] [ text "cAtchVoid" ]
, div
[ id "game" ]
- [ fromElement << gameView <| game ]
+ [ fromElement <| gameView game ]
, p
[]
[ text "Catch the points of your color, avoid the other points." ]
, p
[]
[ text "Use the arrow keys to move and 'e' to change your color." ]
+ , ( if List.isEmpty game.scores
+ then
+ div [ class "bestScore" ] []
+ else
+ let bestScore = List.maximum game.scores
+ in p
+ [ class "bestScore isDefined" ]
+ [ text <| "Best score: " ++ (toString bestScore) ]
+ )
, a
[ href "https://github.com/guyonvarch/catchvoid" ]
[ img