From cb3682637a9a45ee088fd134e8ba67d8114886b7 Mon Sep 17 00:00:00 2001 From: Jasper Van der Jeugt Date: Tue, 4 Aug 2020 17:50:32 +0200 Subject: Small style changes --- client/src/Client.elm | 63 +++++++++++++++++++++++++++------------------------ 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'client/src/Client.elm') diff --git a/client/src/Client.elm b/client/src/Client.elm index 0494140..6d64050 100644 --- a/client/src/Client.elm +++ b/client/src/Client.elm @@ -60,35 +60,39 @@ view model = case model of ] Connecting -> [Html.h1 [] [Html.text "Connecting to room..."]] Game game -> - [ Html.h1 [] [Html.text "Players"] - , Html.ul [] <| List.map - (\o -> Html.li [] [viewPlayer o]) - (game.view.me :: game.view.players) - , Html.h1 [] [Html.text "You"] - , Html.form - [ Html.Attributes.action "" - , Html.Events.onSubmit SubmitMyName - ] - [ Html.input - [ Html.Attributes.value game.changeMyName - , Html.Events.onInput ChangeMyName + [ Html.div [Html.Attributes.class "players"] + [ Html.h1 [] [Html.text "Players"] + , Html.ul [] <| List.map + (\o -> Html.li [] [viewPlayer o]) + (game.view.me :: game.view.players) + , Html.form + [ Html.Attributes.action "" + , Html.Events.onSubmit SubmitMyName ] - [] - , Html.button - [ Html.Attributes.type_ "submit" - , Html.Attributes.disabled <| - game.view.me.name == game.changeMyName || - String.length game.changeMyName > 32 + [ Html.input + [ Html.Attributes.value game.changeMyName + , Html.Events.onInput ChangeMyName + ] + [] + , Html.button + [ Html.Attributes.type_ "submit" + , Html.Attributes.disabled <| + game.view.me.name == game.changeMyName || + String.length game.changeMyName > 32 + ] + [Html.text "Change name"] ] - [Html.text "Update name"] ] - , Html.h1 [] [Html.text "Table"] - , viewTable game - , Html.h1 [] [Html.text "Your cards"] - ] ++ - (List.map - (\c -> whiteCard game.cards c (cardIsSelected game c)) - game.view.hand) + , Html.div [Html.Attributes.class "main"] <| + [ Html.h1 [] [Html.text "Table"] + , viewTable game + , Html.h1 [] [Html.text "Your cards"] + ] + ++ + (List.map + (\c -> whiteCard game.cards c (cardIsSelected game c)) + game.view.hand) + ] tableBlackCard : GameState -> Maybe BlackCard tableBlackCard game = case game.view.table of @@ -189,12 +193,11 @@ blackCard attrs cards black whites = case blackParts of "" :: _ -> capitalizeFirst _ -> identity - blank txt = Html.span - [Html.Attributes.class "blank"] - [Html.text txt] in + filled txt = Html.span [Html.Attributes.class "filled"] [Html.text txt] + blank = Html.span [Html.Attributes.class "blank"] [] in Html.div (List.map Html.Attributes.class ["card", "black"] ++ attrs) <| - intersperseWith (List.map blank whiteParts) (blank "") <| + intersperseWith (List.map filled whiteParts) blank <| List.map Html.text blackParts whiteCardContent : Cards -> WhiteCard -> String -- cgit v1.2.3