2024-12-09 19:53:09 -06:00
|
|
|
module Config.Helpers.ToolTip exposing (..)
|
2024-11-28 00:33:22 -06:00
|
|
|
|
2024-12-27 01:30:21 -06:00
|
|
|
import Config.Style.Colour.Helpers exposing (colourTheme)
|
2024-12-09 19:53:09 -06:00
|
|
|
import Config.Style.Transitions exposing (transitionStyleSlow)
|
2024-11-28 00:33:22 -06:00
|
|
|
import Element as E exposing (..)
|
|
|
|
import Element.Background as B
|
2024-12-09 19:53:09 -06:00
|
|
|
import Element.Border as D
|
2024-11-28 00:33:22 -06:00
|
|
|
import Element.Font as F
|
2024-12-09 19:53:09 -06:00
|
|
|
import Html.Attributes as H
|
2024-11-28 00:33:22 -06:00
|
|
|
|
|
|
|
|
|
|
|
tooltip : String -> Attribute msg
|
|
|
|
tooltip content =
|
|
|
|
inFront <|
|
|
|
|
el
|
2024-12-09 19:53:09 -06:00
|
|
|
[ width fill
|
2024-11-28 00:33:22 -06:00
|
|
|
, height fill
|
|
|
|
, transparent True
|
|
|
|
, mouseOver [ transparent False ]
|
|
|
|
, htmlAttribute <| H.style "z-index" "4"
|
2024-12-09 19:53:09 -06:00
|
|
|
, transitionStyleSlow
|
2024-11-28 00:33:22 -06:00
|
|
|
, below <|
|
|
|
|
el [ htmlAttribute (H.style "pointerEvents" "none") ] <|
|
|
|
|
el
|
2024-12-15 02:31:26 -06:00
|
|
|
[ width <| px 300
|
2024-11-28 00:33:22 -06:00
|
|
|
, htmlAttribute <| H.style "z-index" "4"
|
|
|
|
, F.size 15
|
|
|
|
, F.center
|
|
|
|
, F.regular
|
2024-11-28 00:58:24 -06:00
|
|
|
, B.color colourTheme.backgroundLightGrey
|
|
|
|
, F.color colourTheme.textLightGrey
|
2024-11-28 00:33:22 -06:00
|
|
|
, padding 15
|
2024-11-28 00:58:24 -06:00
|
|
|
, D.color colourTheme.textLightOrange
|
2024-11-28 00:33:22 -06:00
|
|
|
, D.rounded 5
|
|
|
|
, D.width 2
|
|
|
|
, D.shadow
|
|
|
|
{ offset = ( 0, 3 )
|
|
|
|
, blur = 6
|
|
|
|
, size = 0
|
|
|
|
, color = rgba 0 0 0 0.32
|
|
|
|
}
|
|
|
|
]
|
|
|
|
(text content)
|
|
|
|
]
|
|
|
|
none
|
2024-12-19 01:43:02 -06:00
|
|
|
|
|
|
|
|
|
|
|
tooltipImage : String -> Attribute msg
|
|
|
|
tooltipImage content =
|
|
|
|
inFront <|
|
|
|
|
el
|
|
|
|
[ width fill
|
|
|
|
, height fill
|
|
|
|
, transparent True
|
|
|
|
, mouseOver [ transparent False ]
|
|
|
|
, htmlAttribute <| H.style "z-index" "4"
|
|
|
|
, transitionStyleSlow
|
2024-12-19 02:59:18 -06:00
|
|
|
, below <|
|
2024-12-19 01:43:02 -06:00
|
|
|
el
|
|
|
|
[ htmlAttribute (H.style "pointerEvents" "none")
|
2024-12-19 02:59:18 -06:00
|
|
|
, moveLeft 200
|
2024-12-19 01:43:02 -06:00
|
|
|
]
|
|
|
|
<|
|
|
|
|
el
|
2024-12-19 02:59:18 -06:00
|
|
|
[ width <| px 400
|
2024-12-19 01:43:02 -06:00
|
|
|
, htmlAttribute <| H.style "z-index" "4"
|
|
|
|
, B.color colourTheme.backgroundLightGrey
|
2024-12-19 02:59:18 -06:00
|
|
|
|
|
|
|
-- , padding 15
|
2024-12-19 01:43:02 -06:00
|
|
|
, D.color colourTheme.textLightOrange
|
|
|
|
, D.rounded 5
|
|
|
|
, D.width 2
|
|
|
|
, D.shadow
|
|
|
|
{ offset = ( 0, 3 )
|
|
|
|
, blur = 6
|
|
|
|
, size = 0
|
|
|
|
, color = rgba 0 0 0 0.32
|
|
|
|
}
|
|
|
|
]
|
|
|
|
(image
|
|
|
|
[ width fill
|
|
|
|
, height fill
|
|
|
|
, centerX
|
|
|
|
, centerY
|
|
|
|
]
|
|
|
|
{ src = content
|
|
|
|
, description = "Tooltip image"
|
|
|
|
}
|
|
|
|
)
|
|
|
|
]
|
|
|
|
none
|