fix: argument box scale transition working

This commit is contained in:
isaac 2024-11-23 04:18:14 -05:00
parent f79e2d9fca
commit dd9c1dbb23
3 changed files with 49 additions and 28 deletions

View file

@ -33,14 +33,18 @@ argumentMaker onClickMsg areArgsExpanded argument indexExpand =
isArgumentExpanded =
withDefault False <| getAt indexExpand areArgsExpanded
in
column [ explain Debug.todo ]
[ titleMaker onClickMsg indexExpand argument.argumentTitle
column
[ B.color colourTheme.darker
, rounded 10
]
-- [ explain Debug.todo ]
[ titleMaker onClickMsg indexExpand argument.argumentTitle isArgumentExpanded
, paragraphMaker argument isArgumentExpanded
]
titleMaker : (Int -> msg) -> Int -> String -> Element msg
titleMaker onClickMsg indexExpand title =
titleMaker : (Int -> msg) -> Int -> String -> Bool -> Element msg
titleMaker onClickMsg indexExpand title isArgExpanded =
paragraph
(paragraphBoldFormat
++ [ F.size 20
@ -48,17 +52,24 @@ titleMaker onClickMsg indexExpand title =
, B.color colourTheme.highlightText
, paddingEach { top = 6, bottom = 2, left = 12, right = 12 }
, D.width 1
, D.rounded 20
, roundEach { topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 }
, alignBottom
, F.center
, transitionStyle
, mouseOver
[ B.color colourTheme.highlightTextHover
, F.color colourTheme.nonHighlightedText
, D.color colourTheme.highlightTextHover
]
-- , mouseOver
-- [ B.color colourTheme.highlightTextHover
-- , F.color colourTheme.nonHighlightedText
-- , D.color colourTheme.highlightTextHover
-- ]
, V.onClick <| onClickMsg indexExpand
]
++ (if isArgExpanded then
[ rounded 10 ]
else
[ roundEach { topLeft = 10, topRight = 10, bottomRight = 0, bottomLeft = 0 } ]
)
)
[ text title
]
@ -66,22 +77,29 @@ titleMaker onClickMsg indexExpand title =
paragraphMaker : Argument -> Bool -> Element msg
paragraphMaker argument isArgumentExpanded =
row []
[ -- column
-- [ E.alignTop, E.alignLeft ]
-- [ paragraph (paragraphBoldFormat ++ [ F.size 18, E.width <| px 100 ])
-- [-- el [ tooltip below (myTooltip titleTooltip) ] (text title) |> el [ F.color colourTheme.highlightText ]
-- ]
-- ]
-- ,
paragraph
(if isArgumentExpanded then
[ F.size 0, transitionStyle ]
paragraph
(if isArgumentExpanded then
[ height <| px 0
, transitionStyle
, roundEach { topLeft = 0, topRight = 0, bottomRight = 10, bottomLeft = 10 }
else
[ paddingEach { top = 10, right = 0, bottom = 0, left = 0 } ]
)
[ text argument.propositionSummary |> el [ F.color colourTheme.nonHighlightedText, F.regular, F.size 16 ] ]
-- , B.color colourTheme.debugColour
]
-- []
else
[ height <| px 100
, transitionStyle
-- , B.color colourTheme.debugColour
]
)
[ text argument.propositionSummary
|> el
[ F.color colourTheme.nonHighlightedText
, F.regular
, F.size 16
]
]