website/frontend/src/Config/StrengthBar.elm

48 lines
1.2 KiB
Elm
Raw Normal View History

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 (..)
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
, D.color colourTheme.textDarkGrey
, D.width 2
, B.gradient
2024-11-30 04:32:00 -06:00
{ angle = 1.57
, 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) ]
)
none
2024-11-28 19:28:24 -06:00
barPadding : List (Element msg) -> Element msg
barPadding =
column
[ E.width fill
, E.alignLeft
]