feat: standardized formatting conventions across pages

This commit is contained in:
Nick 2024-11-27 22:36:35 -06:00
parent d5e7cfe814
commit ead41f0ed0
19 changed files with 503 additions and 446 deletions

View file

@ -1,5 +1,6 @@
module Cuckery.Helpers exposing (..)
import Config.CardFormat exposing (..)
import Config.Colour exposing (..)
import Config.Format exposing (..)
import Cuckery.Types exposing (..)
@ -19,94 +20,35 @@ import View exposing (View)
cuckMaker : Cuck -> Element msg
cuckMaker cuck =
row
[ spacing 20
, width fill
, E.height fill
, alignTop
, alignRight
]
[ imageMaker cuck
, column
[ E.width <| px 650 ]
[ cuckTitle cuck
, column
[ E.height fill
, E.width fill
, B.color colourTheme.cardBackground
, paddingEach
{ top = 10
, bottom = 10
, left = 10
, right = 10
}
, D.roundEach
{ topLeft = 0
, topRight = 0
, bottomRight = 26
, bottomLeft = 26
}
, spacing 8
]
[ column
[ paddingEach
{ top = 0
, bottom = 0
, left = 15
, right = 15
}
, spacing 8
]
[ socialMaker cuck
, dodgeTitle cuck
, dodgeMaker cuck
topLevelBox
[ cardImageMaker (cuckImage cuck)
, cardMaker
[ cardTitleMaker (cuckTitle cuck)
, cardFormatter
[ cardContentSpacing
[ column
[ fieldSpacer
]
[ socialMaker cuck
, dodgeTitle cuck
, dodgeMaker cuck
]
]
]
]
]
imageMaker : Cuck -> Element msg
imageMaker cuck =
column
[ E.width <| px 115
, E.height <| px 115
, alignTop
, alignRight
]
[ column
[ D.rounded 100
, D.width 5
, D.color colourTheme.cardBackground
, B.color colourTheme.cardBackground
]
[ E.image
[ alignRight
, alignTop
, D.rounded 100
, clip
, E.width <| px 90
, E.height <| px 90
]
{ src = "cucks/" ++ cuck.cuckImage ++ "/" ++ cuck.cuckImage ++ ".png"
, description = cuck.cuckName
}
]
]
cuckImage : Cuck -> { src : String, description : String }
cuckImage cuck =
{ src = "cucks/" ++ cuck.cuckImage ++ "/" ++ cuck.cuckImage ++ ".png"
, description = cuck.cuckName
}
cuckTitle : Cuck -> Element msg
cuckTitle : Cuck -> String
cuckTitle cuck =
row
(nonHighlightedTitleFormat
++ [ F.size 20
, B.color colourTheme.highlightTextHover
, paddingEach { top = 6, bottom = 3, left = 25, right = 15 }
, alignBottom
, width fill
, D.roundEach { topLeft = 26, topRight = 26, bottomRight = 0, bottomLeft = 0 }
]
)
[ text cuck.cuckName ]
cuck.cuckName
dodgeMaker : Cuck -> Element msg
@ -117,16 +59,6 @@ dodgeMaker cuck =
(List.range 1 (List.length cuck.cuckDodges))
dodgeTitle : Cuck -> Element msg
dodgeTitle cuck =
row
(paragraphBoldFormat
++ [ F.size 18
]
)
[ text "Dodges:" ]
socialMaker : Cuck -> Element msg
socialMaker cuck =
row
@ -143,6 +75,16 @@ socialMaker cuck =
]
dodgeTitle : Cuck -> Element msg
dodgeTitle cuck =
row
(paragraphBoldFormat
++ [ F.size 18
]
)
[ text "Dodges:" ]
makeDodge : Dodge -> Int -> Element msg
makeDodge dodgeEntry index =
column