module Pages.Debate.Cucklist exposing (Model, Msg, page) import Config.Data.Identity exposing (pageNames) import Config.Helpers.CardFormat exposing ( cardContentSpacing , cardFormatter , cardMaker , cardTitleMaker , desktopCardMaker , desktopImageBoxSize , desktopImageSize , fieldSpacer , mobileCardMaker , mobileImageBoxSize , mobileImageSize , topLevelBox ) import Config.Helpers.Converters exposing (formatSocial) import Config.Helpers.Format exposing ( paragraphFontSize , paragraphSpacing ) import Config.Helpers.Response exposing ( pageList , topLevelContainer ) import Config.Helpers.Viewport exposing (resetViewport) import Config.Pages.Debate.Cuckery.List exposing ( cuckList , cuckListNumber ) import Config.Pages.Debate.Cuckery.Types exposing (..) import Config.Helpers.Header exposing ( Header , headerMaker ) import Config.Style.Colour exposing (colourTheme) import Config.Style.Transitions exposing ( hoverFontDarkOrange , transitionStyleFast , transitionStyleSlow ) import Effect exposing (Effect) import Element as E exposing (..) import Element.Background as B import Element.Border as D import Element.Font as F import Html.Attributes as H import Layouts import Page exposing (Page) import Route exposing (Route) import Shared import View exposing (View) page : Shared.Model -> Route () -> Page Model Msg page shared route = Page.new { init = init , update = update , subscriptions = subscriptions , view = view shared } |> Page.withLayout toLayout toLayout : Model -> Layouts.Layout Msg toLayout model = Layouts.Navbar {} -- INIT type alias Model = {} init : () -> ( Model, Effect Msg ) init () = ( {} , Effect.map (\_ -> NoOp) (Effect.sendCmd resetViewport) ) -- UPDATE type Msg = NoOp update : Msg -> Model -> ( Model, Effect Msg ) update msg model = case msg of NoOp -> ( model , Effect.none ) -- SUBSCRIPTIONS subscriptions : Model -> Sub Msg subscriptions model = Sub.none -- VIEW view : Shared.Model -> Model -> View Msg view shared model = { title = "debate (" ++ pageNames.pageCucks ++ ")" , attributes = [] , element = cucksContainer shared.device } cucksContainer : Device -> Element msg cucksContainer device = topLevelContainer (cucksList device) cucksList : Device -> Element msg cucksList device = column (case ( device.class, device.orientation ) of _ -> pageList ) <| List.concat [ List.map headerMaker [ cuckListHeader ] , (case ( device.class, device.orientation ) of ( Phone, Portrait ) -> List.map mobileCuckMaker ( Tablet, Portrait ) -> List.map mobileCuckMaker _ -> List.map desktopCuckMaker ) cuckList ] cuckListHeader : Header cuckListHeader = let name = "Cucklist" in { headerTitle = String.toUpper name , headerBody = "This page features a list of morons who wrote cheques with their mouths that their asses couldn't cash. Each person included in this list has dodged debating me." } desktopCuckMaker : Cuck -> Element msg desktopCuckMaker cuck = row topLevelBox [ desktopCardMaker desktopImageBoxSize desktopImageSize (cuckImage cuck) (cuckSocial cuck) , cardMaker [ cardTitleMaker (cuckTitle cuck) , cardFormatter [ cardContentSpacing [ column fieldSpacer [ socialMaker cuck , dodgeTitle cuck , dodgeMaker cuck ] ] ] ] ] mobileCuckMaker : Cuck -> Element msg mobileCuckMaker cuck = column topLevelBox [ column [] [] , cardMaker [ cardTitleMaker (cuckTitle cuck) , cardFormatter [ cardContentSpacing [ column fieldSpacer [ column [ alignTop , centerX , alignLeft , spacing 3 ] [ row [ spacing 10 ] [ mobileCardMaker mobileImageBoxSize mobileImageSize (cuckImage cuck) (cuckSocial cuck) , socialMaker cuck ] , dodgeTitle cuck , dodgeMaker cuck ] ] ] ] ] ] cuckImage : Cuck -> { src : String , description : String } cuckImage cuck = { src = "/cucks/" ++ cuck.cuckImage ++ "/" ++ cuck.cuckImage ++ ".png" , description = cuck.cuckName } cuckTitle : Cuck -> String cuckTitle cuck = cuck.cuckName cuckSocial : Cuck -> String cuckSocial cuck = cuck.cuckSocial dodgeMaker : Cuck -> Element msg dodgeMaker cuck = column [ spacing 10 , width fill ] <| List.map2 (\x y -> makeDodge x y) cuck.cuckDodges (List.range 1 (List.length cuck.cuckDodges)) socialMaker : Cuck -> Element msg socialMaker cuck = paragraph [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold , F.size 18 , spacing 8 ] [ text "Social: " , newTabLink [ paragraphFontSize , F.color colourTheme.textLightOrange ] { url = cuck.cuckSocial , label = el [ transitionStyleSlow , hoverFontDarkOrange ] <| text (formatSocial cuck.cuckSocial) } ] dodgeTitle : Cuck -> Element msg dodgeTitle cuck = paragraph [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold , F.size 18 ] [ text "Dodges: " ] makeDodge : Dodge -> Int -> Element msg makeDodge dodgeEntry index = column [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , alignLeft , spacing 8 , width fill ] [ row [ width fill , paddingEach { top = 0 , right = 0 , bottom = 0 , left = 35 } ] [ column [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.size 18 , alignTop , alignRight , F.alignRight ] [ text (String.fromInt index ++ ". ") ] , column [ spacing 3 , width fill ] [ circumstanceMaker dodgeEntry , column [ spacing 3 , width fill ] [ propositionMaker dodgeEntry , reductioMaker dodgeEntry , attitudeMaker dodgeEntry , reasonMaker dodgeEntry ] ] ] ] dodgeWidth = width <| px 93 formatProposition : String -> String formatProposition proposition = if proposition == "N/A" then proposition else "\"" ++ proposition ++ "\"" dodgeCounter : Int -> Element msg dodgeCounter index = column ([ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize ] ++ [ F.size 18 ] ) [ text (String.fromInt index ++ ". ") ] circumstanceMaker : Dodge -> Element msg circumstanceMaker dodgeEntry = column [ width fill ] [ newTabLink [ paragraphFontSize , F.color colourTheme.textLightOrange ] { url = dodgeEntry.dodgeLink , label = row [ F.size 18 ] [ column [ width fill ] [ paragraph [] [ el [ transitionStyleSlow , hoverFontDarkOrange ] <| text (case dodgeEntry.dodgeDescription of NoReply -> "Debate invitation extended with no response" RanAway -> "Engaged in written debate and ran away when cornered" GhostedMe -> "Debate invitation accepted with no follow-up" OutrightNo -> "Debate invitation declined" InTooDeep -> "Debate invitation accepted and subsequently retracted" KillScreen -> "All further debate invitations preemptively declined" VagueGesture -> "Chose to gesture vaguely instead of engaging" ) , paragraph [ F.color colourTheme.textLightGrey ] [ text "." ] , column [ spacing 5 , F.size 12 ] (List.indexedMap (\index2 link -> newTabLink [ paddingEach { top = 0 , right = 0 , bottom = 0 , left = 5 } ] { url = link , label = row [ moveUp 5 ] [ el [ transitionStyleSlow , hoverFontDarkOrange ] <| text (String.fromInt (index2 + 1)) , text ", " |> el [ F.color colourTheme.textLightGrey ] ] } ) dodgeEntry.dodgeReceipts ) ] ] ] } ] propositionMaker : Dodge -> Element msg propositionMaker dodgeEntry = row [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] [ paragraph [ alignTop , dodgeWidth ] [ text "Proposition:" ] , paragraph [ E.width fill , alignLeft ] [ paragraph [ F.regular ] [ text (formatProposition dodgeEntry.dodgeProposition) ] ] ] attitudeMaker : Dodge -> Element msg attitudeMaker dodgeEntry = row ([ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] ++ [ width fill ] ) [ paragraph [ alignTop , dodgeWidth ] [ text "Attitude:" ] , paragraph [ E.width fill , alignLeft ] [ case dodgeEntry.dodgeNicksDoxasticState of Nothing -> paragraph [ F.regular ] [ text "I don't form a doxastic state." ] Just Belief -> paragraph [ F.regular ] [ text "I lean more toward " , el [ F.bold ] (text "TRUE") , text " than false." ] Just Disbelief -> paragraph [ F.regular ] [ text "I lean more toward " , text "FALSE" |> el [ F.bold ] , text " than true." ] Just Agnostic -> el [ F.regular ] (text "I don't form beliefs about this proposition.") ] ] reductioMaker : Dodge -> Element msg reductioMaker dodgeEntry = case dodgeEntry.dodgeFallacy of Nothing -> none Just fallacy -> case fallacy of SpecificFallacy str -> if String.isEmpty str then none else displayFallacy str AppealToNature -> displayFallacy "Appeal to Nature" AppealToTradition -> displayFallacy "Appeal to Tradition" AppealToIgnorance -> displayFallacy "Appeal to Ignorance" AppealFromIncredulity -> displayFallacy "Appeal from Incredulity" RedHerring -> displayFallacy "Red Herring" BeggingTheQuestion -> displayFallacy "Begging the Question" Strawman -> displayFallacy "Strawman" Equivocation -> displayFallacy "Equivocation" GeneticFallacy -> displayFallacy "Genetic Fallacy" MotteAndBailey -> displayFallacy "Motte and Bailey" reasonMaker : Dodge -> Element msg reasonMaker dodgeEntry = row ([ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] ++ [ width fill ] ) [ paragraph [ alignTop , dodgeWidth ] [ text "Reason:" ] , paragraph [ F.regular ] [ text <| case dodgeEntry.dodgeNicksDoxasticReason of NoProp -> "There is no proposition to evaluate." VagueProp -> "The proposition is too vague to evaluate." SpecificPropReason str -> str ] ] displayFallacy : String -> Element msg displayFallacy fallacyText = row [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] [ paragraph [ alignTop , dodgeWidth ] [ text "Fallacy:" ] , paragraph [ E.width fill , alignLeft ] [ paragraph [ F.regular ] [ text fallacyText ] ] ]