2024-12-11 02:38:42 -06:00
|
|
|
module Pages.Debate.Arguments exposing (Model, Msg, page)
|
2024-11-12 19:23:16 -06:00
|
|
|
|
2024-12-09 19:53:09 -06:00
|
|
|
import Config.Data.Identity exposing (pageNames)
|
2024-12-22 04:36:03 -06:00
|
|
|
import Config.Helpers.Cards.Helpers exposing (cardMaker)
|
|
|
|
import Config.Helpers.Cards.Types as C
|
2024-12-20 00:13:27 -06:00
|
|
|
import Config.Helpers.Converters exposing (toTitleCase)
|
2024-12-15 02:31:26 -06:00
|
|
|
import Config.Helpers.Format
|
|
|
|
exposing
|
2024-12-23 03:15:35 -06:00
|
|
|
( headerFontSizeSmall
|
|
|
|
, paragraphFontSize
|
2024-12-15 02:31:26 -06:00
|
|
|
, paragraphSpacing
|
|
|
|
)
|
2024-12-22 04:36:03 -06:00
|
|
|
import Config.Helpers.Headers.Helpers exposing (..)
|
|
|
|
import Config.Helpers.Headers.Records exposing (argumentHeader)
|
|
|
|
import Config.Helpers.Headers.Types as R exposing (..)
|
2024-12-23 03:15:35 -06:00
|
|
|
import Config.Helpers.ImageFolders as M exposing (..)
|
2024-12-11 03:48:49 -06:00
|
|
|
import Config.Helpers.Response
|
2024-12-09 19:53:09 -06:00
|
|
|
exposing
|
2024-12-09 20:30:04 -06:00
|
|
|
( pageList
|
2024-12-09 19:53:09 -06:00
|
|
|
, topLevelContainer
|
|
|
|
)
|
2024-12-15 02:31:26 -06:00
|
|
|
import Config.Helpers.StrengthBar
|
|
|
|
exposing
|
|
|
|
( barMaker
|
|
|
|
, barPadding
|
|
|
|
)
|
|
|
|
import Config.Helpers.ToolTip exposing (tooltip)
|
2024-12-09 19:53:09 -06:00
|
|
|
import Config.Helpers.Viewport exposing (resetViewport)
|
2024-12-15 02:31:26 -06:00
|
|
|
import Config.Pages.Debate.Arguments.List
|
|
|
|
exposing
|
|
|
|
( argumentList
|
|
|
|
)
|
2024-12-09 19:53:09 -06:00
|
|
|
import Config.Pages.Debate.Arguments.Types exposing (..)
|
2024-12-15 02:31:26 -06:00
|
|
|
import Config.Style.Colour exposing (colourTheme)
|
|
|
|
import Config.Style.Glow
|
|
|
|
exposing
|
|
|
|
( glowDeepDarkGrey
|
|
|
|
, glowDeepDarkOrange
|
|
|
|
)
|
|
|
|
import Config.Style.Transitions exposing (transitionStyleSlow)
|
2024-11-12 19:23:16 -06:00
|
|
|
import Effect exposing (Effect)
|
2024-12-09 19:53:09 -06:00
|
|
|
import Element as E exposing (..)
|
2024-12-15 02:31:26 -06:00
|
|
|
import Element.Background as B
|
|
|
|
import Element.Border as D
|
|
|
|
import Element.Font as F
|
|
|
|
import Html exposing (div, hr)
|
|
|
|
import Html.Attributes as H exposing (style, title, wrap)
|
2024-11-12 19:23:16 -06:00
|
|
|
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
|
2024-12-06 02:13:22 -06:00
|
|
|
, view = view shared
|
2024-11-12 19:23:16 -06:00
|
|
|
}
|
|
|
|
|> Page.withLayout toLayout
|
|
|
|
|
|
|
|
|
|
|
|
toLayout : Model -> Layouts.Layout Msg
|
|
|
|
toLayout model =
|
2024-12-07 15:43:26 -06:00
|
|
|
Layouts.Navbar {}
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- INIT
|
|
|
|
|
|
|
|
|
|
|
|
type alias Model =
|
2024-11-27 15:11:21 -06:00
|
|
|
{}
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
init : () -> ( Model, Effect Msg )
|
|
|
|
init () =
|
2024-11-27 15:11:21 -06:00
|
|
|
( {}
|
2024-12-03 21:17:17 -06:00
|
|
|
, Effect.batch
|
|
|
|
[ Effect.map
|
|
|
|
(\_ -> NoOp)
|
|
|
|
(Effect.sendCmd resetViewport)
|
|
|
|
, Effect.none
|
|
|
|
]
|
2024-11-12 19:23:16 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- UPDATE
|
|
|
|
|
|
|
|
|
|
|
|
type Msg
|
2024-11-27 15:11:21 -06:00
|
|
|
= NoOp
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
update : Msg -> Model -> ( Model, Effect Msg )
|
|
|
|
update msg model =
|
2024-11-27 15:11:21 -06:00
|
|
|
case msg of
|
|
|
|
NoOp ->
|
|
|
|
( model
|
|
|
|
, Effect.none
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- SUBSCRIPTIONS
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
subscriptions : Model -> Sub Msg
|
|
|
|
subscriptions model =
|
2024-11-27 15:11:21 -06:00
|
|
|
Sub.none
|
2024-11-12 19:23:16 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- VIEW
|
|
|
|
|
|
|
|
|
2024-12-06 02:13:22 -06:00
|
|
|
view : Shared.Model -> Model -> View Msg
|
|
|
|
view shared model =
|
2024-12-08 02:18:36 -06:00
|
|
|
{ title = "debate (" ++ pageNames.pageArguments ++ ")"
|
2024-11-12 19:23:16 -06:00
|
|
|
, attributes = []
|
2024-12-06 02:13:22 -06:00
|
|
|
, element = debateContainer shared.device
|
2024-11-12 19:23:16 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-12-06 02:13:22 -06:00
|
|
|
debateContainer : Device -> Element msg
|
|
|
|
debateContainer device =
|
|
|
|
topLevelContainer (debateList device)
|
|
|
|
|
|
|
|
|
|
|
|
debateList : Device -> Element msg
|
|
|
|
debateList device =
|
|
|
|
column
|
|
|
|
(case ( device.class, device.orientation ) of
|
2024-12-07 15:43:26 -06:00
|
|
|
_ ->
|
2024-12-22 19:42:23 -06:00
|
|
|
pageList device
|
2024-12-06 02:13:22 -06:00
|
|
|
)
|
|
|
|
<|
|
|
|
|
List.concat
|
2024-12-22 04:36:03 -06:00
|
|
|
[ [ headerMaker (R.Arguments argumentHeader) ]
|
|
|
|
, List.map
|
2024-12-21 23:23:59 -06:00
|
|
|
(\argument ->
|
2024-12-23 03:15:35 -06:00
|
|
|
cardMaker device (C.Argument argument) (contentList device argument)
|
2024-12-21 23:23:59 -06:00
|
|
|
)
|
2024-12-08 02:18:36 -06:00
|
|
|
argumentList
|
2024-12-06 02:13:22 -06:00
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
|
|
|
|
|
2024-12-23 03:15:35 -06:00
|
|
|
contentList : Device -> Argument -> List (Element msg)
|
|
|
|
contentList device argument =
|
|
|
|
[ row
|
|
|
|
[ width fill
|
|
|
|
, paddingEach
|
|
|
|
{ top =
|
|
|
|
case ( device.class, device.orientation ) of
|
|
|
|
( Phone, Portrait ) ->
|
|
|
|
8
|
|
|
|
|
|
|
|
( Tablet, Portrait ) ->
|
|
|
|
8
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
[ column [ width fill, spacing 8 ]
|
2024-12-23 04:16:05 -06:00
|
|
|
[ summaryMakerDesktop device argument
|
|
|
|
, strengthBar device argument
|
2024-12-23 03:15:35 -06:00
|
|
|
]
|
|
|
|
, case ( device.class, device.orientation ) of
|
|
|
|
( Phone, Portrait ) ->
|
|
|
|
none
|
|
|
|
|
|
|
|
( Tablet, Portrait ) ->
|
|
|
|
none
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
argumentImageMaker argument
|
|
|
|
]
|
|
|
|
, tableMaker device argument
|
2024-12-21 04:07:50 -06:00
|
|
|
, desktopFormalizationMaker argument
|
2024-12-23 03:15:35 -06:00
|
|
|
, proofTreeButton argument.proofLink
|
2024-12-21 04:07:50 -06:00
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
|
|
|
|
|
2024-12-23 03:15:35 -06:00
|
|
|
argumentImageMaker : Argument -> Element msg
|
|
|
|
argumentImageMaker argument =
|
|
|
|
el
|
|
|
|
[ alignRight
|
|
|
|
, alignTop
|
|
|
|
, centerY
|
|
|
|
, paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 0
|
|
|
|
, bottom = 0
|
|
|
|
, left = 20
|
|
|
|
}
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
el
|
|
|
|
[ D.rounded 10
|
|
|
|
, D.width 3
|
|
|
|
, D.color colourTheme.backgroundLightGrey
|
|
|
|
, B.color colourTheme.backgroundLightGrey
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
E.image
|
|
|
|
[ alignRight
|
|
|
|
, alignTop
|
|
|
|
, D.rounded 10
|
|
|
|
, clip
|
|
|
|
, E.width <| px 65
|
|
|
|
, E.height <| px 65
|
|
|
|
]
|
|
|
|
{ src = imagePathMaker M.Argument argument.argumentImage
|
|
|
|
, description = ""
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
proofTreeButton : String -> Element msg
|
|
|
|
proofTreeButton url =
|
|
|
|
newTabLink
|
|
|
|
[ alignTop
|
|
|
|
, alignRight
|
|
|
|
, paddingXY 0 5
|
|
|
|
]
|
|
|
|
{ url = url
|
|
|
|
, label =
|
|
|
|
el
|
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, B.color colourTheme.textDarkOrange
|
|
|
|
, D.rounded 10
|
|
|
|
, paddingEach
|
|
|
|
{ top = 6
|
|
|
|
, bottom = 3
|
|
|
|
, left = 10
|
|
|
|
, right = 10
|
|
|
|
}
|
|
|
|
, mouseOver
|
|
|
|
[ F.color colourTheme.textLightOrange
|
|
|
|
, B.color colourTheme.textDeepDarkOrange
|
|
|
|
]
|
|
|
|
, transitionStyleSlow
|
|
|
|
, headerFontSizeSmall
|
|
|
|
, F.bold
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
text
|
|
|
|
"Proof Tree"
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2024-12-15 02:31:26 -06:00
|
|
|
infoSpacing =
|
|
|
|
E.width <| px 100
|
|
|
|
|
|
|
|
|
|
|
|
propositionMaker : Element msg
|
|
|
|
propositionMaker =
|
|
|
|
column
|
|
|
|
[ E.alignTop, E.alignLeft ]
|
|
|
|
[ paragraph
|
2024-12-23 03:15:35 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, headerFontSizeSmall
|
|
|
|
, F.bold
|
|
|
|
, infoSpacing
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ el
|
|
|
|
[ tooltip
|
|
|
|
"A proposition is a declarative statement that can be evaluated as either true or false, and which serves as the basis for debate."
|
|
|
|
]
|
|
|
|
(text "Proposition:")
|
|
|
|
|> el [ F.color colourTheme.textLightOrange ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
propositionTitleMaker : Argument -> Element msg
|
|
|
|
propositionTitleMaker argument =
|
|
|
|
column
|
|
|
|
[ E.width fill, E.alignLeft ]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, headerFontSizeSmall
|
|
|
|
, F.bold
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ text argument.propositionTitle
|
|
|
|
|> el
|
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, F.regular
|
2024-12-23 03:24:08 -06:00
|
|
|
, paragraphFontSize
|
2024-12-15 02:31:26 -06:00
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
reductioMakerDesktop : Argument -> Element msg
|
|
|
|
reductioMakerDesktop argument =
|
|
|
|
case argument.propositionReductio of
|
|
|
|
"" ->
|
|
|
|
none
|
|
|
|
|
|
|
|
reductio ->
|
|
|
|
row
|
|
|
|
[]
|
|
|
|
[ reductioMaker
|
|
|
|
, reductioMakerTitle reductio
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
reductioMaker : Element msg
|
|
|
|
reductioMaker =
|
|
|
|
column
|
|
|
|
[ E.alignTop, E.alignLeft ]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, headerFontSizeSmall
|
|
|
|
, F.bold
|
|
|
|
, infoSpacing
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ el
|
|
|
|
[ tooltip
|
|
|
|
"This is the position from which the reductio ad absurdum is derived."
|
|
|
|
]
|
|
|
|
(text "Reductio:")
|
|
|
|
|> el [ F.color colourTheme.textLightOrange ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
reductioMakerTitle : String -> Element msg
|
|
|
|
reductioMakerTitle reductio =
|
|
|
|
column [ E.width fill, E.alignLeft ]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
, spacing 3
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ text reductio ]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-12-23 04:16:05 -06:00
|
|
|
summaryMakerDesktop : Device -> Argument -> Element msg
|
|
|
|
summaryMakerDesktop device argument =
|
|
|
|
(case ( device.class, device.orientation ) of
|
|
|
|
( Phone, Portrait ) ->
|
|
|
|
column
|
2024-12-15 02:31:26 -06:00
|
|
|
|
2024-12-23 04:16:05 -06:00
|
|
|
( Tablet, Portrait ) ->
|
|
|
|
column
|
2024-12-15 02:31:26 -06:00
|
|
|
|
2024-12-23 04:16:05 -06:00
|
|
|
_ ->
|
|
|
|
row
|
|
|
|
)
|
|
|
|
[]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ summaryMaker
|
|
|
|
, summaryMakerTitle argument
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
summaryMaker : Element msg
|
|
|
|
summaryMaker =
|
|
|
|
column
|
|
|
|
[ E.alignTop
|
|
|
|
, E.alignLeft
|
|
|
|
]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
, F.bold
|
|
|
|
, infoSpacing
|
|
|
|
, headerFontSizeSmall
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ el
|
|
|
|
[ tooltip
|
|
|
|
"The following information provides additional context and insight into the reasoning behind the argument."
|
|
|
|
]
|
|
|
|
(text "Summary:")
|
|
|
|
|> el [ F.color colourTheme.textLightOrange ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
summaryMakerTitle : Argument -> Element msg
|
|
|
|
summaryMakerTitle argument =
|
|
|
|
column
|
|
|
|
[ E.width fill
|
|
|
|
, E.alignLeft
|
|
|
|
]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, F.bold
|
|
|
|
, spacing 3
|
|
|
|
, headerFontSizeSmall
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ text argument.propositionSummary
|
|
|
|
|> el
|
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, F.regular
|
2024-12-23 03:24:08 -06:00
|
|
|
, paragraphFontSize
|
2024-12-15 02:31:26 -06:00
|
|
|
]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2024-12-23 04:16:05 -06:00
|
|
|
strengthBar : Device -> Argument -> Element msg
|
|
|
|
strengthBar device argument =
|
|
|
|
(case ( device.class, device.orientation ) of
|
|
|
|
( Phone, Portrait ) ->
|
|
|
|
column
|
|
|
|
|
|
|
|
( Tablet, Portrait ) ->
|
|
|
|
column
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
row
|
|
|
|
)
|
|
|
|
[ E.width fill ]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ strengthMaker
|
|
|
|
, strengthMakerBar argument
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
strengthMaker : Element msg
|
|
|
|
strengthMaker =
|
|
|
|
column
|
|
|
|
[ E.alignTop
|
|
|
|
, E.alignLeft
|
|
|
|
]
|
|
|
|
[ paragraph
|
2024-12-23 03:24:08 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
, F.bold
|
|
|
|
, E.width fill
|
|
|
|
, headerFontSizeSmall
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
[ el
|
|
|
|
[ tooltip
|
|
|
|
"This represents my confidence in the soundness of the argument."
|
|
|
|
]
|
|
|
|
(el
|
|
|
|
[ paddingEach
|
|
|
|
{ top = 0
|
|
|
|
, right = 5
|
|
|
|
, bottom = 0
|
|
|
|
, left = 0
|
|
|
|
}
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
text "Confidence:"
|
|
|
|
)
|
|
|
|
|> el [ F.color colourTheme.textLightOrange ]
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
strengthMakerBar : Argument -> Element msg
|
|
|
|
strengthMakerBar argument =
|
|
|
|
barPadding
|
|
|
|
[ barMaker getConfidenceTooltip argument.argumentCertainty ]
|
|
|
|
|
|
|
|
|
|
|
|
getConfidenceTooltip : Int -> String
|
|
|
|
getConfidenceTooltip num =
|
|
|
|
case num of
|
|
|
|
0 ->
|
|
|
|
"Extremely low. Speculative reasoning."
|
|
|
|
|
|
|
|
1 ->
|
|
|
|
"Very low. Extremely weak reasoning."
|
|
|
|
|
|
|
|
2 ->
|
|
|
|
"Low. Weak reasoning."
|
|
|
|
|
|
|
|
3 ->
|
|
|
|
"Kinda low. Somewhat weak reasoning."
|
|
|
|
|
|
|
|
4 ->
|
|
|
|
"Below average. More weak than strong."
|
|
|
|
|
|
|
|
5 ->
|
|
|
|
"Moderate. OK reasoning."
|
|
|
|
|
|
|
|
6 ->
|
|
|
|
"Above average. More strong than weak."
|
|
|
|
|
|
|
|
7 ->
|
|
|
|
"Kinda high. Somewhat strong reasoning."
|
|
|
|
|
|
|
|
8 ->
|
|
|
|
"High. Robust reasoning."
|
|
|
|
|
|
|
|
9 ->
|
|
|
|
"Very high. Extremely robust reasoning."
|
|
|
|
|
|
|
|
10 ->
|
|
|
|
"Extremely high. Air tight reasoning."
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
"Confidence level out of expected range."
|
|
|
|
|
|
|
|
|
2024-12-23 03:15:35 -06:00
|
|
|
tableMaker : Device -> Argument -> Element msg
|
|
|
|
tableMaker device argument =
|
2024-12-22 04:36:03 -06:00
|
|
|
let
|
|
|
|
cellPadding : Attribute msg
|
|
|
|
cellPadding =
|
|
|
|
paddingXY 10 5
|
|
|
|
in
|
2024-12-15 02:31:26 -06:00
|
|
|
column
|
|
|
|
[ centerX
|
|
|
|
, E.width fill
|
|
|
|
]
|
2024-12-22 04:36:03 -06:00
|
|
|
[ el
|
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
, F.bold
|
|
|
|
, E.alignLeft
|
|
|
|
, E.width fill
|
|
|
|
, htmlAttribute <| H.style "position" "relative"
|
|
|
|
]
|
|
|
|
<|
|
|
|
|
E.table
|
2024-12-23 03:15:35 -06:00
|
|
|
([ D.rounded 10
|
|
|
|
, D.width 2
|
|
|
|
, D.color colourTheme.textDarkGrey
|
|
|
|
, clip
|
|
|
|
]
|
|
|
|
++ (case ( device.class, device.orientation ) of
|
|
|
|
( Phone, Portrait ) ->
|
|
|
|
[ B.color colourTheme.backgroundSpreadsheet ]
|
|
|
|
|
|
|
|
( Tablet, Portrait ) ->
|
|
|
|
[ B.color colourTheme.backgroundSpreadsheet ]
|
|
|
|
|
|
|
|
_ ->
|
|
|
|
[]
|
|
|
|
)
|
|
|
|
)
|
2024-12-15 02:31:26 -06:00
|
|
|
{ data = argument.definitionTable
|
|
|
|
, columns =
|
|
|
|
[ { header =
|
|
|
|
el
|
|
|
|
[ F.bold
|
|
|
|
, D.widthEach
|
|
|
|
{ bottom = 1
|
|
|
|
, top = 1
|
|
|
|
, left = 1
|
|
|
|
, right = 1
|
|
|
|
}
|
|
|
|
, D.color colourTheme.textDarkGrey
|
2024-12-22 04:36:03 -06:00
|
|
|
, cellPadding
|
2024-12-15 02:31:26 -06:00
|
|
|
, E.width fill
|
|
|
|
]
|
2024-12-22 04:36:03 -06:00
|
|
|
<|
|
|
|
|
el [ F.color colourTheme.textLightOrange ] <|
|
|
|
|
text "Definiendum"
|
|
|
|
, width = fill |> maximum 30
|
2024-12-15 02:31:26 -06:00
|
|
|
, view =
|
|
|
|
\definition ->
|
2024-12-22 04:36:03 -06:00
|
|
|
el
|
2024-12-15 02:31:26 -06:00
|
|
|
[ F.color colourTheme.textLightOrange
|
|
|
|
, F.bold
|
|
|
|
, D.widthEach
|
|
|
|
{ bottom = 1
|
|
|
|
, top = 0
|
|
|
|
, left = 1
|
|
|
|
, right = 1
|
|
|
|
}
|
|
|
|
, D.color colourTheme.textDarkGrey
|
2024-12-22 04:36:03 -06:00
|
|
|
, cellPadding
|
2024-12-15 02:31:26 -06:00
|
|
|
, E.height fill
|
|
|
|
]
|
2024-12-22 04:36:03 -06:00
|
|
|
<|
|
|
|
|
el [ centerX ] <|
|
|
|
|
paragraph [] [ text definition.definiendum ]
|
2024-12-15 02:31:26 -06:00
|
|
|
}
|
|
|
|
, { header =
|
|
|
|
el
|
|
|
|
[ F.bold
|
|
|
|
, D.widthEach
|
|
|
|
{ bottom = 1
|
|
|
|
, top = 1
|
|
|
|
, left = 0
|
|
|
|
, right = 1
|
|
|
|
}
|
|
|
|
, D.color colourTheme.textDarkGrey
|
2024-12-22 04:36:03 -06:00
|
|
|
, cellPadding
|
2024-12-15 02:31:26 -06:00
|
|
|
, E.width fill
|
|
|
|
]
|
2024-12-22 04:36:03 -06:00
|
|
|
<|
|
|
|
|
el
|
|
|
|
[ F.color colourTheme.textLightOrange ]
|
|
|
|
<|
|
|
|
|
text "Definiens"
|
2024-12-15 02:31:26 -06:00
|
|
|
, width = fill
|
|
|
|
, view =
|
|
|
|
\definition ->
|
2024-12-22 04:36:03 -06:00
|
|
|
el
|
2024-12-15 02:31:26 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, F.regular
|
|
|
|
, D.widthEach
|
|
|
|
{ bottom = 1
|
|
|
|
, top = 0
|
|
|
|
, left = 0
|
|
|
|
, right = 1
|
|
|
|
}
|
|
|
|
, D.color colourTheme.textDarkGrey
|
2024-12-22 04:36:03 -06:00
|
|
|
, cellPadding
|
2024-12-15 02:31:26 -06:00
|
|
|
, E.height fill
|
|
|
|
]
|
2024-12-22 04:36:03 -06:00
|
|
|
<|
|
|
|
|
el [] <|
|
|
|
|
paragraph [] [ text definition.definiens ]
|
2024-12-15 02:31:26 -06:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
argumentDesktopPadding : Attribute msg
|
|
|
|
argumentDesktopPadding =
|
|
|
|
paddingXY 40 3
|
|
|
|
|
|
|
|
|
|
|
|
desktopFormalizationMaker : Argument -> Element msg
|
|
|
|
desktopFormalizationMaker argument =
|
|
|
|
formalizationMaker argument argumentDesktopPadding
|
|
|
|
|
|
|
|
|
|
|
|
formalizationMaker : Argument -> Attribute msg -> Element msg
|
|
|
|
formalizationMaker argument padding =
|
|
|
|
column
|
|
|
|
[ centerX
|
|
|
|
, E.width fill
|
|
|
|
, spacing 10
|
|
|
|
]
|
|
|
|
(List.indexedMap
|
|
|
|
(\index argumentEntry ->
|
|
|
|
column
|
2024-12-22 04:36:03 -06:00
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, paragraphSpacing
|
|
|
|
, paragraphFontSize
|
|
|
|
, spacing 3
|
|
|
|
, centerX
|
|
|
|
, E.width fill
|
|
|
|
, padding
|
|
|
|
]
|
2024-12-15 02:31:26 -06:00
|
|
|
(List.indexedMap
|
|
|
|
(\entryIndex entryWithNotation ->
|
|
|
|
column
|
|
|
|
[ centerX
|
|
|
|
, F.center
|
|
|
|
, spacing 3
|
|
|
|
, E.width fill
|
|
|
|
]
|
|
|
|
[ paragraph
|
|
|
|
[ F.color colourTheme.textLightOrange
|
|
|
|
, F.bold
|
|
|
|
, spacing 3
|
2024-12-18 20:11:04 -06:00
|
|
|
, paragraphFontSize
|
2024-12-15 02:31:26 -06:00
|
|
|
]
|
|
|
|
[ text
|
|
|
|
(if entryIndex < List.length argumentEntry.premises then
|
|
|
|
"P" ++ String.fromInt (entryIndex + 1) ++ ") "
|
|
|
|
|
|
|
|
else
|
|
|
|
"C) "
|
|
|
|
)
|
|
|
|
, text
|
|
|
|
(if entryIndex < List.length argumentEntry.premises then
|
|
|
|
entryWithNotation.premise
|
|
|
|
|
|
|
|
else
|
|
|
|
argumentEntry.conclusion
|
|
|
|
)
|
|
|
|
|> el
|
|
|
|
[ F.color colourTheme.textLightGrey
|
|
|
|
, F.regular
|
|
|
|
, E.width fill
|
|
|
|
]
|
|
|
|
]
|
|
|
|
, paragraph
|
|
|
|
[ centerX
|
|
|
|
, F.center
|
|
|
|
, spacing 3
|
|
|
|
, E.width fill
|
|
|
|
, F.color colourTheme.textLightOrange
|
|
|
|
, F.bold
|
|
|
|
]
|
|
|
|
[ text
|
|
|
|
(if entryIndex < List.length argumentEntry.premises then
|
|
|
|
"(" ++ entryWithNotation.notation ++ ")"
|
|
|
|
|
|
|
|
else
|
|
|
|
"(∴" ++ argumentEntry.conclusionNotation ++ ")"
|
|
|
|
)
|
|
|
|
]
|
|
|
|
]
|
|
|
|
)
|
|
|
|
(argumentEntry.premises ++ [ { premise = argumentEntry.conclusion, notation = argumentEntry.conclusionNotation } ])
|
|
|
|
)
|
|
|
|
)
|
|
|
|
argument.argumentFormalization
|
|
|
|
)
|