website/frontend/src/Config/Format.elm

209 lines
4.2 KiB
Elm
Raw Normal View History

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 =
[ spacing 40
, centerX
, centerY
, alignTop
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-16 16:44:46 -06:00
htmlAttribute <| style "transition" "all .1s"
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"
imageSpacer : Attribute msg
imageSpacer =
spacing 20
2024-11-11 18:57:51 -06:00
navBarLinkFormat : List (Attr () msg)
navBarLinkFormat =
[ F.size 15
2024-11-16 00:44:39 -06:00
, centerX
2024-11-11 18:57:51 -06:00
-- , F.bold
]
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 =
spacing 8
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-11 00:43:03 -06:00
paragraphColumnFormat : List (Attribute msg)
paragraphColumnFormat =
[ spacing 20
2024-11-11 18:57:51 -06:00
, paragraphWidth
2024-11-11 00:43:03 -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)
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