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 ( headerFontSizeSmall , paragraphFontSize , paragraphSpacing ) import Config.Helpers.Headers.Header exposing (headerMaker) import Config.Helpers.Headers.Types exposing (Header) import Config.Helpers.Response exposing ( pageList , topLevelContainer ) import Config.Helpers.ToolTip exposing (tooltipImage) import Config.Helpers.Viewport exposing (resetViewport) import Config.Pages.Debate.Cuckery.List exposing ( cuckList , cuckListNumber ) import Config.Pages.Debate.Cuckery.Types exposing (..) 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 cuck 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 : Cuck -> Dodge -> Int -> Element msg makeDodge cuck dodge 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 cuck dodge , column [ spacing 3 , width fill ] [ propositionMaker dodge , reductioMaker dodge , attitudeMaker dodge , reasonMaker dodge ] ] ] ] 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 , headerFontSizeSmall ] [ text (String.fromInt index ++ ". ") ] circumstanceMaker : Cuck -> Dodge -> Element msg circumstanceMaker cuck dodge = el [ spacing 5 ] <| newTabLink [ paragraphFontSize , F.color colourTheme.textLightOrange ] { url = dodge.dodgeLink , label = el [ headerFontSizeSmall ] <| circumstance cuck dodge } circumstance : Cuck -> Dodge -> Element msg circumstance cuck dodge = paragraph [] [ el [ transitionStyleSlow , hoverFontDarkOrange ] <| case dodge.dodgeDescription of NoReply -> text "Debate invitation extended with no response" RanAway -> text "Engaged in written debate and ran away when cornered" GhostedMe -> text "Debate invitation accepted with no follow-up" OutrightNo -> text "Debate invitation declined" InTooDeep -> text "Debate invitation accepted and subsequently retracted" KillScreen -> text "All further debate invitations preemptively declined" VagueGesture -> text "Chose to gesture vaguely instead of engaging" , el [ F.color colourTheme.textLightGrey ] <| text "." -- , receipts cuck dodge ] receipts : Cuck -> Dodge -> Element msg receipts cuck dodge = row [ spacing 3 , F.size 12 , paddingEach { top = 0 , right = 0 , bottom = 0 , left = 3 } , htmlAttribute (H.style "position" "relative") , htmlAttribute (H.style "top" "-5px") ] <| List.indexedMap (\index2 link -> paragraph [ alignTop , F.color colourTheme.textLightOrange ] [ el [ transitionStyleSlow , hoverFontDarkOrange ] (text (String.fromInt (index2 + 1))) , text ", " |> el [ F.color colourTheme.textLightGrey ] ] ) dodge.dodgeReceipts propositionMaker : Dodge -> Element msg propositionMaker dodge = row [ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] [ paragraph [ alignTop , dodgeWidth ] [ text "Proposition:" ] , paragraph [ E.width fill , alignLeft ] [ paragraph [ F.regular ] [ text (formatProposition dodge.dodgeProposition) ] ] ] attitudeMaker : Dodge -> Element msg attitudeMaker dodge = row ([ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] ++ [ width fill ] ) [ paragraph [ alignTop , dodgeWidth ] [ text "Attitude:" ] , paragraph [ E.width fill , alignLeft ] [ case dodge.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 dodge = case dodge.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 dodge = row ([ F.color colourTheme.textLightGrey , paragraphSpacing , paragraphFontSize , F.bold ] ++ [ width fill ] ) [ paragraph [ alignTop , dodgeWidth ] [ text "Reason:" ] , paragraph [ F.regular ] [ text <| case dodge.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 ] ] ]