Skip to content

Commit

Permalink
add a circle to the current players
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHicks committed Sep 22, 2020
1 parent 0fa336e commit 9510b05
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/Main.elm
Expand Up @@ -448,6 +448,11 @@ rankings model =
previousRank =
Dict.get player.name previousStandings
|> Maybe.withDefault rank

isPlaying =
League.currentMatch model.league
|> Maybe.map (\(League.Match a b) -> player == a || player == b)
|> Maybe.withDefault False
in
( player.name
, Html.tr
Expand All @@ -458,7 +463,10 @@ rankings model =
, Css.textAlign Css.center
]
]
(if rank < previousRank then
(if isPlaying then
[ circle (Css.hex "EFE700") ]

else if rank < previousRank then
[ upArrow (Css.hex "6DD400")
, Html.span
[ css
Expand Down Expand Up @@ -604,6 +612,20 @@ downArrow color =
[]


circle : Css.Color -> Html msg
circle color =
Html.div
[ css
[ Css.width (Css.px 10)
, Css.height (Css.px 10)
, Css.borderRadius (Css.pct 100)
, Css.backgroundColor color
, Css.margin2 Css.zero Css.auto
]
]
[]


main : Program Flags Model Msg
main =
Browser.document
Expand Down

0 comments on commit 9510b05

Please sign in to comment.