mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 12:25:12 -05:00
150 lines
4.1 KiB
Elm
150 lines
4.1 KiB
Elm
![]() |
module Debate.Gibberish.Helpers exposing (..)
|
||
|
|
||
|
import Config.CardFormat exposing (..)
|
||
|
import Config.Colour as T exposing (..)
|
||
|
import Config.Format as O exposing (..)
|
||
|
import Config.StrengthBar exposing (..)
|
||
|
import Config.ToolTip exposing (..)
|
||
|
import Debate.Gibberish.Domains.Epistemology exposing (..)
|
||
|
import Debate.Gibberish.Domains.Metaphysics exposing (..)
|
||
|
import Debate.Gibberish.Domains.Normativity exposing (..)
|
||
|
import Debate.Gibberish.Domains.Ontology exposing (..)
|
||
|
import Debate.Gibberish.Domains.PhilOfLanguage exposing (..)
|
||
|
import Debate.Gibberish.Domains.PhilOfMind exposing (..)
|
||
|
import Debate.Gibberish.Domains.Theology exposing (..)
|
||
|
import Debate.Gibberish.Types exposing (..)
|
||
|
import Debate.Types exposing (..)
|
||
|
import Effect exposing (Effect)
|
||
|
import Element as E exposing (..)
|
||
|
import Element.Background as B exposing (..)
|
||
|
import Element.Border as D exposing (..)
|
||
|
import Element.Events as V exposing (..)
|
||
|
import Element.Font as F exposing (..)
|
||
|
import Html exposing (div, hr)
|
||
|
import Html.Attributes as H exposing (style, title, wrap)
|
||
|
import Json.Decode exposing (field)
|
||
|
import Layouts
|
||
|
import Page exposing (Page)
|
||
|
import Route exposing (Route)
|
||
|
import Shared
|
||
|
import View exposing (View)
|
||
|
|
||
|
|
||
|
gibberishMaker : Gibberish -> Element msg
|
||
|
gibberishMaker gibberish =
|
||
|
row
|
||
|
topLevelBox
|
||
|
[ cardImageMaker (gibberishImage gibberish)
|
||
|
, cardMaker
|
||
|
[ cardTitleMaker (gibberishTitle gibberish)
|
||
|
, cardFormatter
|
||
|
[ cardContentSpacing
|
||
|
[ column
|
||
|
fieldSpacer
|
||
|
[ domainList gibberish ]
|
||
|
]
|
||
|
]
|
||
|
]
|
||
|
]
|
||
|
|
||
|
|
||
|
gibberishImage : Gibberish -> { src : String, description : String }
|
||
|
gibberishImage gibberish =
|
||
|
{ src = "gibberish/" ++ gibberish.gibberishImage ++ ".png"
|
||
|
, description = gibberish.gibberishTitle
|
||
|
}
|
||
|
|
||
|
|
||
|
gibberishTitle : Gibberish -> String
|
||
|
gibberishTitle gibberish =
|
||
|
gibberish.gibberishTitle
|
||
|
|
||
|
|
||
|
domainList : Gibberish -> Element msg
|
||
|
domainList gibberish =
|
||
|
column
|
||
|
[ spacing 8
|
||
|
, E.width fill
|
||
|
]
|
||
|
<|
|
||
|
List.map2 (\x y -> makeDomain x)
|
||
|
gibberish.gibberishDomain
|
||
|
(List.range 1 (List.length gibberish.gibberishDomain))
|
||
|
|
||
|
|
||
|
makeDomain : Domain -> Element msg
|
||
|
makeDomain domain =
|
||
|
column
|
||
|
(paragraphAlignLeft
|
||
|
++ [ spacing 8
|
||
|
, E.width fill
|
||
|
]
|
||
|
)
|
||
|
[ column
|
||
|
(paragraphBoldFormat
|
||
|
++ [ F.size 18
|
||
|
, alignTop
|
||
|
, E.alignLeft
|
||
|
, F.alignLeft
|
||
|
, F.color colourTheme.textLightOrange
|
||
|
]
|
||
|
)
|
||
|
[ text domain.gibberishDomainName ]
|
||
|
, column
|
||
|
[ spacing 8
|
||
|
, E.width fill
|
||
|
]
|
||
|
<|
|
||
|
List.map2 (\x y -> makeTerms x)
|
||
|
domain.gibberishTerms
|
||
|
(List.range 1 (List.length domain.gibberishTerms))
|
||
|
]
|
||
|
|
||
|
|
||
|
makeTerms : Terms -> Element msg
|
||
|
makeTerms terms =
|
||
|
column
|
||
|
(paragraphAlignLeft
|
||
|
++ [ spacing 8
|
||
|
, E.width fill
|
||
|
]
|
||
|
)
|
||
|
[ paragraph
|
||
|
[ F.color colourTheme.textLightGrey
|
||
|
, F.regular
|
||
|
, F.size 16
|
||
|
]
|
||
|
[ text ("\"" ++ terms.term ++ "\"") ]
|
||
|
, paragraph
|
||
|
[ F.color colourTheme.textLightGrey
|
||
|
, F.regular
|
||
|
, F.size 16
|
||
|
]
|
||
|
[ paragraph
|
||
|
[ paddingEach
|
||
|
{ top = 0
|
||
|
, bottom = 0
|
||
|
, left = 35
|
||
|
, right = 0
|
||
|
}
|
||
|
]
|
||
|
[ text terms.explanation ]
|
||
|
]
|
||
|
]
|
||
|
|
||
|
|
||
|
gibberishList : Gibberish
|
||
|
gibberishList =
|
||
|
{ gibberishTitle = "Philosobabble"
|
||
|
, gibberishImage = "gibberish"
|
||
|
, gibberishDomain =
|
||
|
[ epistemologyGibberish
|
||
|
, theologyGibberish
|
||
|
, metaphysicsGibberish
|
||
|
, normativityGibberish
|
||
|
, ontologyGibberish
|
||
|
, philOfMindGibberish
|
||
|
, philOfLanguageGibberish
|
||
|
]
|
||
|
}
|