From 6c1f5e10631a3f66f4c85a45b6f28ffd366105c5 Mon Sep 17 00:00:00 2001 From: Joris Guyonvarch Date: Sat, 7 Mar 2015 18:46:47 +0100 Subject: Show best score in html layout --- src/View/Page.elm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/View/Page.elm') 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 -- cgit v1.2.3