Skip to content

Commit

Permalink
UI aesthetics (#76)
Browse files Browse the repository at this point in the history
* removed unused variable

* clean up and text styling
  • Loading branch information
Leoactionz authored Oct 17, 2021
1 parent d6dfcaf commit 9cf7974
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/Game.elm
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ update msg (Model model) =
|> map (nextPlayerStartsPlaying Human piece)
|> andThen (computerChooses ComputerSelectedCell Board.openCells)

( HumanSelectedPiece piece, _ ) ->
( HumanSelectedPiece _, _ ) ->
Model { model | statusMessage = SomePiecePlayedWhenNotPlayersTurn }
|> noCmds

Expand Down Expand Up @@ -208,7 +208,7 @@ playerTryPlay name piece (Model model) =


checkForWin : ActivePlayer -> Model -> ( Model, Cmd Msg )
checkForWin player (Model ({ board, status } as model)) =
checkForWin player (Model ({ board } as model)) =
case ( player, Board.status board ) of
( Computer, CanContinue ) ->
Model model
Expand Down
9 changes: 3 additions & 6 deletions src/Pages/Top.elm
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,16 @@ import Element
( Attribute
, Element
, centerX
, centerY
, column
, el
, fill
, height
, padding
, paragraph
, px
, row
, spacing
, text
, width
, wrappedRow

)
import Element.Background as Background
import Element.Border as Border
Expand Down Expand Up @@ -183,7 +180,7 @@ viewBoard cellDict =


viewGamestatus : GameStatus -> Dimensions -> Element Msg
viewGamestatus gamestatus dimensions =
viewGamestatus gamestatus _ =
let
containerize : List (Element Msg) -> Element Msg
containerize elements =
Expand Down Expand Up @@ -232,7 +229,7 @@ viewStatusMessage statusMessage =
Element.el [] (Element.text "")

SomePiecePlayedWhenNotPlayersTurn ->
Element.el [ centerX, Font.center, Region.announce ] (Element.text "It's not your turn to choose a piece!")
Element.el [ centerX, Font.center, Region.announce, Font.color Styles.red, Font.semiBold ] (Element.text "It's not your turn to choose a piece!")


viewCell : Cell -> Element Msg
Expand Down

0 comments on commit 9cf7974

Please sign in to comment.