@@ -6,16 +6,18 @@ import Char
6import Html exposing (..)
6import Html exposing (..)
7import Html.Attributes exposing (..)
7import Html.Attributes exposing (..)
8import String
8import String
9+import Json.Decode as D
16+main : Program D.Value Model ()
16 Browser.fullscreen
18 Browser.fullscreen
17− { init = \env -> (env.flags, Cmd.none)
19+ { init = \env -> (D.decodeValue decodeExit env.flags, Cmd.none)
18− , update = \_ model -> (model, Cmd.none)
20+ , update = \_ exit -> (exit, Cmd.none)
19 , view = view
21 , view = view
20 , subscriptions = \_ -> Sub.none
22 , subscriptions = \_ -> Sub.none
21 , onNavigation = Nothing
23 , onNavigation = Nothing
@@ -23,31 +25,56 @@ main =
38+decodeExit : D.Decoder Exit
29−view : String -> Browser.View msg
47+view : Model -> Browser.View msg
30−view message =
48+view result =
31− { title = "Error"
49+ { title = "Problem!"
33− [ div
51+ case result of
34− [ style "width" "100%"
52+ Err err ->
35− , style "min-height" "100%"
53+ [ text (D.errorToString err) ]
36− , style "display" "flex"
54+
37− , style "flex-direction" "column"
55+ Ok exit ->
38− , style "align-items" "center"
56+ [ viewExit exit ]
39− , style "background-color" "black"
40− , style "color" "rgb(233, 235, 235)"
41− , style "font-family" "monospace"
44− [ style "display" "block"
45− , style "white-space" "pre"
46− , style "background-color" "rgb(39, 40, 34)"
47− , style "padding" "2em"
60+viewExit : Exit -> Html msg
63+ [ style "width" "100%"
64+ , style "min-height" "100%"
65+ , style "display" "flex"
66+ , style "flex-direction" "column"
67+ , style "align-items" "center"
68+ , style "background-color" "black"
69+ , style "color" "rgb(233, 235, 235)"
70+ , style "font-family" "monospace"
73+ [ style "display" "block"
74+ , style "white-space" "pre"
75+ , style "background-color" "rgb(39, 40, 34)"
76+ , style "padding" "2em"