2024-12-09 19:53:09 -06:00
|
|
|
module Config.Helpers.StrengthBar exposing (..)
|
2024-11-27 22:36:35 -06:00
|
|
|
|
2024-12-09 19:53:09 -06:00
|
|
|
import Config.Helpers.ToolTip exposing (..)
|
|
|
|
import Config.Style.Colour exposing (..)
|
2024-11-27 22:36:35 -06:00
|
|
|
import Element as E exposing (..)
|
2024-12-09 19:53:09 -06:00
|
|
|
import Element.Background as B
|
2024-11-27 22:36:35 -06:00
|
|
|
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
|
2024-11-28 00:58:24 -06:00
|
|
|
, D.color colourTheme.textDarkGrey
|
2024-11-27 22:36:35 -06:00
|
|
|
, D.width 2
|
|
|
|
, B.gradient
|
2024-11-30 04:32:00 -06:00
|
|
|
{ angle = 1.57
|
2024-11-27 22:36:35 -06:00
|
|
|
, steps =
|
|
|
|
List.concat
|
|
|
|
[ List.repeat num colourTheme.barGreen
|
|
|
|
, List.repeat (10 - num) colourTheme.barRed
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
2024-11-28 00:33:22 -06:00
|
|
|
++ [ tooltip (getTooltip num) ]
|
2024-11-27 22:36:35 -06:00
|
|
|
)
|
|
|
|
none
|
2024-11-28 19:28:24 -06:00
|
|
|
|
|
|
|
|
|
|
|
barPadding : List (Element msg) -> Element msg
|
|
|
|
barPadding =
|
|
|
|
column
|
|
|
|
[ E.width fill
|
|
|
|
, E.alignLeft
|
|
|
|
]
|