Skip to content

Commit

Permalink
Fix mobile view
Browse files Browse the repository at this point in the history
  • Loading branch information
Qluxzz committed Oct 27, 2024
1 parent 9d07b52 commit c7dfe7e
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 16 deletions.
18 changes: 9 additions & 9 deletions src/Main.elm
Original file line number Diff line number Diff line change
Expand Up @@ -610,16 +610,16 @@ view model =
model.players
in
Html.div [ Html.Attributes.class "game" ]
((if model.state /= Betting then
dealerView model.dealer model.state
:: List.map playerView (allPlayers model.players)
[ Html.div [ Html.Attributes.class "dealer-and-players" ]
(if model.state /= Betting then
dealerView model.dealer model.state
:: List.map playerView (allPlayers model.players)

else
[ Html.text "" ]
)
++ [ actionsView model.state currentPlayer
]
)
else
[ Html.text "" ]
)
, actionsView model.state currentPlayer
]
, Maybe.map toastView model.toast |> Maybe.withDefault (Html.text "")
]

Expand Down
33 changes: 26 additions & 7 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ h6 {
}


body>div {
.game {
flex-grow: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-around;
justify-content: end;
gap: 20px;
}


.main-menu {
display: flex;
align-items: center;
Expand All @@ -81,6 +83,14 @@ body>div {
.logo {
display: flex;

@media (max-width: 500px) {
margin-left: 50px;

.card:not(:first-child) {
margin-left: -65px;
}
}

.card-inner {
top: -100vh;

Expand Down Expand Up @@ -147,18 +157,27 @@ body>div {
}
}

.dealer-and-players {
display: flex;
flex-direction: column;
flex-grow: 1;
justify-content: space-around;
}

.actions {
position: absolute;
bottom: 0px;
left: 0;
right: 0;
justify-content: center;
align-items: center;
display: flex;
gap: 10px;
height: 100px;
padding: 10px;
min-height: 120px;
background-color: #083c01;
width: 100%;
flex-direction: column;

@media (min-width: 500px) {
flex-direction: row;
}
}

.hands {
Expand Down

0 comments on commit c7dfe7e

Please sign in to comment.