stabilizes Header and Player bars
This commit is contained in:
23
src/Main.elm
23
src/Main.elm
@@ -292,7 +292,15 @@ viewHeaderBar model =
|
||||
, div [ class "navbar-menu is-active" ]
|
||||
[ div [class "navbar-end"]
|
||||
[ a [class "navbar-item", href "/marchand"] [text "Marchand"]
|
||||
, a [class "navbar-item", href "/coffre"] [text "Coffre de groupe"]
|
||||
, a
|
||||
[ class "navbar-item"
|
||||
, href (if model.player.id == 0
|
||||
then
|
||||
"/nouveau-tresor"
|
||||
else
|
||||
"/coffre")
|
||||
]
|
||||
[text (if model.player.id == 0 then "Nouveau loot" else "Coffre de groupe")]
|
||||
]
|
||||
]
|
||||
|
||||
@@ -321,15 +329,18 @@ viewPlayerBar player route =
|
||||
, div [class "level-right"] (viewPlayerAction player route)
|
||||
]
|
||||
|
||||
actionButton t = button [ class "button" ] [ text t ]
|
||||
actionButton t n c = button [ class ("button is-rounded is-" ++ c) ]
|
||||
[ span [ class "icon" ] [ i [ class ("fas fa-" ++ n) ] [] ]
|
||||
, span [] [ text t ]
|
||||
]
|
||||
|
||||
viewPlayerAction : Player -> Route -> List (Html Msg)
|
||||
viewPlayerAction player route =
|
||||
case route of
|
||||
PlayerChest -> [actionButton "Vendre" ]
|
||||
GroupLoot -> [actionButton "Demander" ]
|
||||
Merchant -> [actionButton "Acheter" ]
|
||||
NewLoot -> [actionButton "Valider" ]
|
||||
PlayerChest -> [actionButton "Vendre" "coins" "danger"]
|
||||
GroupLoot -> [actionButton "Demander" "coins" "primary"]
|
||||
Merchant -> [actionButton "Acheter" "coins" "success"]
|
||||
NewLoot -> [actionButton "Valider" "coins" "primary", actionButton "Annuler" "coins" "danger"]
|
||||
|
||||
|
||||
showWealth : Wealth -> List (Html Msg)
|
||||
|
||||
Reference in New Issue
Block a user