website/frontend/src/Config/Helpers/StrengthBar.elm
2024-12-09 19:53:09 -06:00

37 lines
916 B
Elm
Executable file

module Config.Helpers.StrengthBar exposing (..)
import Config.Helpers.ToolTip exposing (..)
import Config.Style.Colour exposing (..)
import Element as E exposing (..)
import Element.Background as B
import Element.Border as D
barMaker : (Int -> String) -> Int -> Element msg
barMaker getTooltip num =
el
([ E.height <| px 12
, E.width fill
, D.rounded 10
, D.color colourTheme.textDarkGrey
, D.width 2
, B.gradient
{ angle = 1.57
, steps =
List.concat
[ List.repeat num colourTheme.barGreen
, List.repeat (10 - num) colourTheme.barRed
]
}
]
++ [ tooltip (getTooltip num) ]
)
none
barPadding : List (Element msg) -> Element msg
barPadding =
column
[ E.width fill
, E.alignLeft
]