2024-11-27 22:36:35 -06:00
|
|
|
module Config.StrengthBar exposing (..)
|
|
|
|
|
|
|
|
import Config.Colour exposing (..)
|
|
|
|
import Config.Format exposing (..)
|
2024-11-28 00:33:22 -06:00
|
|
|
import Config.ToolTip exposing (..)
|
2024-12-08 02:18:36 -06:00
|
|
|
import Debate.Cuckery.Types exposing (..)
|
2024-11-27 22:36:35 -06:00
|
|
|
import Effect exposing (Effect)
|
|
|
|
import Element as E exposing (..)
|
|
|
|
import Element.Background as B exposing (..)
|
|
|
|
import Element.Border as D
|
|
|
|
import Element.Font as F
|
|
|
|
import Html.Attributes as H exposing (style)
|
|
|
|
import Layouts
|
|
|
|
import Page exposing (Page)
|
|
|
|
import Route exposing (Route)
|
|
|
|
import Shared
|
|
|
|
import View exposing (View)
|
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
]
|