2024-11-11 21:57:27 -06:00
|
|
|
module Config.Format exposing (..)
|
2024-11-10 22:55:49 -06:00
|
|
|
|
2024-11-11 21:57:27 -06:00
|
|
|
import Config.Colour exposing (..)
|
2024-11-20 22:47:57 -06:00
|
|
|
import Element as E exposing (..)
|
2024-11-10 22:55:49 -06:00
|
|
|
import Element.Background as B
|
2024-11-20 22:47:57 -06:00
|
|
|
import Element.Border as D exposing (..)
|
2024-11-10 22:55:49 -06:00
|
|
|
import Element.Font as F
|
2024-11-20 22:47:57 -06:00
|
|
|
import Html exposing (col)
|
2024-11-11 18:57:51 -06:00
|
|
|
import Html.Attributes as H exposing (style)
|
2024-11-10 22:55:49 -06:00
|
|
|
|
|
|
|
|
2024-11-11 00:43:03 -06:00
|
|
|
topLevelContainer : Element msg -> Element msg
|
|
|
|
topLevelContainer =
|
|
|
|
el
|
2024-11-20 22:47:57 -06:00
|
|
|
[ E.width fill
|
2024-11-11 00:43:03 -06:00
|
|
|
, height fill
|
|
|
|
, B.color colourTheme.backgroundColour
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
pageList : List (Attribute msg)
|
|
|
|
pageList =
|
2024-11-26 04:32:11 -06:00
|
|
|
[ spacing 30
|
2024-11-24 01:53:40 -06:00
|
|
|
, centerX
|
2024-11-11 18:57:51 -06:00
|
|
|
, centerY
|
2024-11-20 14:40:40 -06:00
|
|
|
, paddingEach { top = 30, bottom = 30, left = 30, right = 30 }
|
2024-11-11 18:57:51 -06:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
transitionStyle : Attribute msg
|
|
|
|
transitionStyle =
|
2024-11-26 04:32:11 -06:00
|
|
|
htmlAttribute <| style "transition" "all 0.3s ease-in-out"
|
2024-11-11 18:57:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
transitionHighlightedLinkHover : Element msg -> Element msg
|
|
|
|
transitionHighlightedLinkHover =
|
|
|
|
el
|
|
|
|
[ mouseOver [ F.color colourTheme.highlightTextHover ]
|
|
|
|
, transitionStyle
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
transitionNonHighlightedLinkHover : Element msg -> Element msg
|
|
|
|
transitionNonHighlightedLinkHover =
|
|
|
|
el
|
|
|
|
[ mouseOver [ F.color colourTheme.highlightText ]
|
|
|
|
, transitionStyle
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-12 19:23:16 -06:00
|
|
|
transitionNonHighlightedLinkHoverWithMove : Element msg -> Element msg
|
2024-11-16 00:44:39 -06:00
|
|
|
transitionNonHighlightedLinkHoverWithMove content =
|
2024-11-12 19:23:16 -06:00
|
|
|
el
|
2024-11-20 22:47:57 -06:00
|
|
|
[ E.width fill
|
2024-11-16 00:44:39 -06:00
|
|
|
, height (px 30)
|
2024-11-12 19:23:16 -06:00
|
|
|
]
|
2024-11-16 00:44:39 -06:00
|
|
|
(el
|
|
|
|
[ centerX
|
|
|
|
, centerY
|
|
|
|
, mouseOver [ F.color colourTheme.highlightText, F.size 25 ]
|
|
|
|
, transitionStyle
|
|
|
|
]
|
|
|
|
content
|
|
|
|
)
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
2024-11-11 00:43:03 -06:00
|
|
|
spartanFont : F.Font
|
|
|
|
spartanFont =
|
|
|
|
F.typeface "League Spartan"
|
|
|
|
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
navBarLinkFormat : List (Attr () msg)
|
|
|
|
navBarLinkFormat =
|
2024-11-26 21:17:31 -06:00
|
|
|
[ F.size 17
|
2024-11-11 18:57:51 -06:00
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-11 00:43:03 -06:00
|
|
|
titleFormat : List (Attr () msg)
|
|
|
|
titleFormat =
|
|
|
|
[ F.size 23
|
|
|
|
, F.bold
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
nonHighlightedTitleFormat : List (Attr () msg)
|
|
|
|
nonHighlightedTitleFormat =
|
|
|
|
[ F.color colourTheme.nonHighlightedText
|
|
|
|
]
|
|
|
|
++ titleFormat
|
|
|
|
|
|
|
|
|
|
|
|
highlightedTitleFormat : List (Attr () msg)
|
|
|
|
highlightedTitleFormat =
|
|
|
|
[ F.color colourTheme.highlightText
|
|
|
|
]
|
|
|
|
++ titleFormat
|
|
|
|
|
|
|
|
|
2024-11-11 00:43:03 -06:00
|
|
|
paragraphFontSize : Attr decorative msg
|
|
|
|
paragraphFontSize =
|
|
|
|
F.size 17
|
|
|
|
|
|
|
|
|
|
|
|
paragraphLinkFormat : { url : String, label : Element msg } -> Element msg
|
|
|
|
paragraphLinkFormat =
|
|
|
|
newTabLink
|
|
|
|
[ paragraphFontSize
|
|
|
|
, F.color colourTheme.highlightText
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-11 21:57:27 -06:00
|
|
|
paragraphSpacing : Attribute msg
|
|
|
|
paragraphSpacing =
|
2024-11-26 04:32:11 -06:00
|
|
|
spacing 3
|
2024-11-11 21:57:27 -06:00
|
|
|
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
paragraphText : List (Attr () msg)
|
|
|
|
paragraphText =
|
|
|
|
[ F.color colourTheme.nonHighlightedText
|
2024-11-11 21:57:27 -06:00
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
paragraphHightlightedBoldText : List (Attr () msg)
|
|
|
|
paragraphHightlightedBoldText =
|
|
|
|
[ F.color colourTheme.highlightText
|
|
|
|
, F.bold
|
|
|
|
, paragraphSpacing
|
2024-11-11 00:43:03 -06:00
|
|
|
, paragraphFontSize
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
paragraphFormat : List (Attr () msg)
|
|
|
|
paragraphFormat =
|
|
|
|
[]
|
|
|
|
++ paragraphText
|
|
|
|
|
|
|
|
|
|
|
|
paragraphBoldFormat : List (Attr () msg)
|
|
|
|
paragraphBoldFormat =
|
|
|
|
[ F.bold ]
|
|
|
|
++ paragraphText
|
|
|
|
|
|
|
|
|
|
|
|
paragraphWidth : Attribute msg
|
|
|
|
paragraphWidth =
|
2024-11-20 22:47:57 -06:00
|
|
|
E.width <| px 700
|
2024-11-11 18:57:51 -06:00
|
|
|
|
|
|
|
|
|
|
|
paragraphAlignLeft : List (Attr () msg)
|
|
|
|
paragraphAlignLeft =
|
|
|
|
[ alignLeft, paragraphWidth ]
|
|
|
|
++ paragraphText
|
|
|
|
|
2024-11-12 19:23:16 -06:00
|
|
|
|
2024-11-11 21:57:27 -06:00
|
|
|
paragraphAlignCenter : List (Attr () msg)
|
|
|
|
paragraphAlignCenter =
|
|
|
|
[ centerX, paragraphWidth ]
|
|
|
|
++ paragraphText
|
|
|
|
|
2024-11-11 18:57:51 -06:00
|
|
|
|
2024-11-20 22:47:57 -06:00
|
|
|
myTooltip : String -> Element msg
|
|
|
|
myTooltip str =
|
|
|
|
el
|
|
|
|
[ B.color colourTheme.backgroundColour
|
|
|
|
, F.color colourTheme.nonHighlightedText
|
|
|
|
, padding 15
|
|
|
|
, D.rounded 5
|
|
|
|
, D.width 2
|
|
|
|
, F.center
|
|
|
|
, E.width <| px 300
|
|
|
|
, D.color colourTheme.highlightText
|
|
|
|
, F.size 15
|
|
|
|
, D.shadow
|
|
|
|
{ offset = ( 0, 3 ), blur = 6, size = 0, color = rgba 0 0 0 0.32 }
|
|
|
|
]
|
|
|
|
(text str)
|
2024-11-21 01:26:54 -06:00
|
|
|
|> el [ F.color colourTheme.nonHighlightedText, F.regular, F.size 14 ]
|
|
|
|
|
2024-11-20 22:47:57 -06:00
|
|
|
|
|
|
|
tooltip : (Element msg -> Attribute msg) -> Element Never -> Attribute msg
|
|
|
|
tooltip usher tooltip_ =
|
|
|
|
inFront <|
|
|
|
|
el
|
|
|
|
[ E.width fill
|
|
|
|
, height fill
|
|
|
|
, transparent True
|
|
|
|
, mouseOver [ transparent False ]
|
|
|
|
, (usher << map never) <|
|
|
|
|
el [ htmlAttribute (style "pointerEvents" "none") ]
|
|
|
|
tooltip_
|
|
|
|
]
|
|
|
|
none
|
2024-11-26 21:17:31 -06:00
|
|
|
|
|
|
|
|
|
|
|
basicDivider : Element msg
|
|
|
|
basicDivider =
|
|
|
|
el
|
|
|
|
[ E.width fill
|
|
|
|
, centerX
|
|
|
|
, D.widthEach { bottom = 1, top = 0, left = 0, right = 0 }
|
|
|
|
, D.color (rgb255 200 200 200)
|
|
|
|
, paddingEach { top = 40, bottom = 0, left = 0, right = 0 }
|
|
|
|
]
|
|
|
|
none
|