mirror of
https://gitlab.com/upRootNutrition/website.git
synced 2025-06-16 12:25:12 -05:00
feat: did a ton of work
This commit is contained in:
parent
a220b0d9c1
commit
078bd0ac70
67 changed files with 358 additions and 192 deletions
|
@ -13,7 +13,7 @@ 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.Attributes exposing (form, id)
|
||||
import Html.Attributes exposing (form, id, style)
|
||||
import Layouts
|
||||
import List.Extra exposing (..)
|
||||
import Maybe exposing (withDefault)
|
||||
|
@ -24,18 +24,6 @@ import Shared
|
|||
import View exposing (View)
|
||||
|
||||
|
||||
|
||||
-- (if isArgumentExpanded then
|
||||
-- [ height <| px 0
|
||||
-- , transitionStyle
|
||||
-- , roundEach { topLeft = 0, topRight = 0, bottomRight = 10, bottomLeft = 10 }
|
||||
-- ]
|
||||
-- else
|
||||
-- [
|
||||
-- ]
|
||||
-- )
|
||||
|
||||
|
||||
type alias ArgMakerInput msg =
|
||||
{ arg : Argument
|
||||
, index : Int
|
||||
|
@ -47,12 +35,31 @@ type alias ArgMakerInput msg =
|
|||
|
||||
argumentMaker : ArgMakerInput msg -> Element msg
|
||||
argumentMaker argMakerInput =
|
||||
-- row [ imageSpacer, E.alignLeft ]
|
||||
-- [ E.image
|
||||
-- (case argMakerInput.maybeHeight of
|
||||
-- Nothing ->
|
||||
-- [ transparent True ]
|
||||
-- Just _ ->
|
||||
-- [ centerX
|
||||
-- , centerY
|
||||
-- , alignTop
|
||||
-- , D.rounded 100
|
||||
-- , E.width <| px 52
|
||||
-- ]
|
||||
-- )
|
||||
-- { src = "arguments/" ++ argMakerInput.arg.argumentImage ++ ".png"
|
||||
-- , description = ""
|
||||
-- }
|
||||
-- ,
|
||||
column
|
||||
(if isNothing argMakerInput.maybeHeight then
|
||||
[ E.htmlAttribute (id <| "arg" ++ String.fromInt argMakerInput.index) ]
|
||||
[ E.htmlAttribute (id <| "arg" ++ String.fromInt argMakerInput.index)
|
||||
, E.width <| px 600
|
||||
]
|
||||
|
||||
else
|
||||
[]
|
||||
[ E.width <| px 600, alignTop ]
|
||||
)
|
||||
[ titleMaker argMakerInput
|
||||
, column
|
||||
|
@ -60,7 +67,8 @@ argumentMaker argMakerInput =
|
|||
Just h ->
|
||||
[ B.color colourTheme.cardBackground
|
||||
, clip
|
||||
, transitionStyle
|
||||
, htmlAttribute <| style "transition" "all .7s ease-in-out"
|
||||
, roundEach { topLeft = 0, topRight = 0, bottomRight = 20, bottomLeft = 20 }
|
||||
, height <|
|
||||
px <|
|
||||
if argMakerInput.isExpanded then
|
||||
|
@ -85,6 +93,10 @@ argumentMaker argMakerInput =
|
|||
]
|
||||
|
||||
|
||||
|
||||
-- ]
|
||||
|
||||
|
||||
titleMaker : ArgMakerInput msg -> Element msg
|
||||
titleMaker argMakerInput =
|
||||
paragraph
|
||||
|
@ -93,16 +105,14 @@ titleMaker argMakerInput =
|
|||
, F.color colourTheme.backgroundColour
|
||||
, B.color colourTheme.highlightText
|
||||
, paddingEach { top = 6, bottom = 2, left = 12, right = 12 }
|
||||
, D.width 1
|
||||
, roundEach { topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 }
|
||||
, alignBottom
|
||||
, roundEach { topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 }
|
||||
, F.center
|
||||
, transitionStyle
|
||||
, pointer
|
||||
, htmlAttribute <| style "transition" "all 0.3s ease-in-out"
|
||||
, mouseOver
|
||||
[ B.color colourTheme.highlightTextHover
|
||||
, F.color colourTheme.nonHighlightedText
|
||||
, D.color colourTheme.highlightTextHover
|
||||
]
|
||||
, V.onClick <| argMakerInput.titleClickMsg
|
||||
]
|
||||
|
@ -111,7 +121,14 @@ titleMaker argMakerInput =
|
|||
[ transparent True ]
|
||||
|
||||
Just _ ->
|
||||
[ roundEach { topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 } ]
|
||||
[ roundEach <|
|
||||
if argMakerInput.isExpanded then
|
||||
{ topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 }
|
||||
|
||||
else
|
||||
{ topLeft = 10, topRight = 10, bottomRight = 10, bottomLeft = 10 }
|
||||
, F.alignLeft
|
||||
]
|
||||
)
|
||||
)
|
||||
[ text argMakerInput.arg.argumentTitle ]
|
||||
|
@ -120,7 +137,8 @@ titleMaker argMakerInput =
|
|||
propositionMaker : ArgMakerInput msg -> Element msg
|
||||
propositionMaker argMakerInput =
|
||||
row
|
||||
[ paddingEach { top = 10, right = 0, bottom = 0, left = 0 }
|
||||
[ paddingEach { top = 20, right = 30, bottom = 0, left = 30 }
|
||||
, E.width fill
|
||||
]
|
||||
[ column
|
||||
[ E.alignTop, E.alignLeft ]
|
||||
|
@ -153,7 +171,7 @@ reductioMaker argMakerInput =
|
|||
none
|
||||
|
||||
reductio ->
|
||||
row []
|
||||
row [ paddingEach { top = 8, right = 30, bottom = 0, left = 30 }, E.width fill ]
|
||||
[ column
|
||||
[ E.alignTop, E.alignLeft ]
|
||||
[ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ])
|
||||
|
@ -169,7 +187,7 @@ reductioMaker argMakerInput =
|
|||
|
||||
summaryMaker : ArgMakerInput msg -> Element msg
|
||||
summaryMaker argMakerInput =
|
||||
row []
|
||||
row [ paddingEach { top = 10, right = 30, bottom = 0, left = 30 } ]
|
||||
[ column
|
||||
[ E.alignTop, E.alignLeft ]
|
||||
[ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ])
|
||||
|
@ -202,7 +220,7 @@ strengthMaker argMakerInput =
|
|||
barMaker num =
|
||||
el
|
||||
[ E.height <| px 12
|
||||
, E.width <| px 500
|
||||
, E.width fill
|
||||
, D.rounded 10
|
||||
, D.color colourTheme.nonHighlightedDarkText
|
||||
, D.width 2
|
||||
|
@ -228,10 +246,10 @@ strengthMaker argMakerInput =
|
|||
"Very low. Extremely weak reasoning."
|
||||
|
||||
2 ->
|
||||
"Kinda low. Weak reasoning."
|
||||
"Low. Weak reasoning."
|
||||
|
||||
3 ->
|
||||
"Low. Somewhat weak reasoning."
|
||||
"Kinda low. Somewhat weak reasoning."
|
||||
|
||||
4 ->
|
||||
"Below average. More weak than strong."
|
||||
|
@ -243,10 +261,10 @@ strengthMaker argMakerInput =
|
|||
"Above average. More strong than weak."
|
||||
|
||||
7 ->
|
||||
"High. Somewhat strong reasoning."
|
||||
"Kinda high. Somewhat strong reasoning."
|
||||
|
||||
8 ->
|
||||
"Kinda high. Robust reasoning."
|
||||
"High. Robust reasoning."
|
||||
|
||||
9 ->
|
||||
"Very high. Extremely robust reasoning."
|
||||
|
@ -257,7 +275,7 @@ strengthMaker argMakerInput =
|
|||
_ ->
|
||||
"Confidence level out of expected range."
|
||||
in
|
||||
row [ paddingEach { top = 10, right = 0, bottom = 0, left = 0 } ]
|
||||
row [ paddingEach { top = 10, right = 30, bottom = 0, left = 30 }, E.width fill ]
|
||||
[ column
|
||||
[ E.alignTop, E.alignLeft ]
|
||||
[ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ])
|
||||
|
@ -281,7 +299,7 @@ tableMaker argMakerInput =
|
|||
in
|
||||
List.indexedMap
|
||||
(\index argumentEntry ->
|
||||
column (paragraphFormat ++ [ spacing 3, centerX, E.width <| px 500, paddingEach { top = 10, right = 0, bottom = 0, left = 0 } ])
|
||||
column (paragraphFormat ++ [ spacing 3, centerX, E.width fill, paddingEach { top = 10, right = 30, bottom = 0, left = 30 } ])
|
||||
(List.indexedMap
|
||||
(\premiseIndex premiseWithNotation ->
|
||||
column argumentFormatting
|
||||
|
@ -313,7 +331,11 @@ tableMaker argMakerInput =
|
|||
)
|
||||
argMakerInput.arg.argumentFormalization
|
||||
in
|
||||
column [ centerX, E.width <| px 600 ]
|
||||
column
|
||||
[ centerX
|
||||
, paddingEach { top = 8, right = 30, bottom = 0, left = 30 }
|
||||
, E.width fill
|
||||
]
|
||||
[ wrappedRow (paragraphBoldFormat ++ [ E.alignLeft, E.width fill ])
|
||||
[ E.table
|
||||
[ spacing 0
|
||||
|
@ -381,19 +403,22 @@ tableMaker argMakerInput =
|
|||
|
||||
proofTreeMaker : ArgMakerInput msg -> Element msg
|
||||
proofTreeMaker argMakerInput =
|
||||
row [ paddingEach { top = 10, right = 0, bottom = 10, left = 0 }, centerX, E.width fill ]
|
||||
[ column [ E.alignRight ]
|
||||
row
|
||||
[ paddingEach { top = 8, right = 30, bottom = 0, left = 30 }
|
||||
, centerX
|
||||
, E.width fill
|
||||
]
|
||||
[ column [ E.width fill ]
|
||||
[ newTabLink
|
||||
(paragraphBoldFormat
|
||||
++ [ F.size 18
|
||||
, F.color colourTheme.backgroundColour
|
||||
, B.color colourTheme.highlightText
|
||||
, paddingEach { top = 6, bottom = 2, left = 12, right = 12 }
|
||||
, D.width 1
|
||||
, D.rounded 10
|
||||
, E.width <| px 105
|
||||
, F.center
|
||||
, E.alignRight
|
||||
, alignBottom
|
||||
, transitionStyle
|
||||
, mouseOver
|
||||
[ B.color colourTheme.highlightTextHover
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue