@@ -4,7 +4,6 @@ import Prelude hiding (add)
44import Data.Tuple.Nested ((/\))
55import Debug.Trace (spy)
66import Effect (Effect)
7−import Effect.Unsafe (unsafePerformEffect)
87import JSS (jssClasses)
98import Justifill (justifill)
109import React.Basic.DOM (css)
@@ -36,14 +35,14 @@ mkAnimated = do
3635 box <- Box.makeComponent
3736 component "Animated Example" \{} -> React.do
3837 toggled /\ modifyToggled <- useState false
39− springStyles /\ set <- useSpring $ const { marginTop: "80px", marginBottom: "80px", opacity: 0.7, transform: "scale3d(" <> if toggled then "0.9, 0.9, 1.0" else "1.0, 2.0, 1.0" <> ")" }
38+ { style, set, stop } <- useSpring $ const { opacity: 0.7, transform: "scale3d(" <> if toggled then "0.9, 0.9, 1.0" else "1.0, 2.0, 1.0" <> ")" }
4039 useLayoutEffect toggled do
41− set { marginTop: "80px", marginBottom: "30px", opacity: if toggled then 0.7 else 0.9, transform: "scale3d(" <> if toggled then "0.9, 0.9, 1.0" else "1.0, 2.0, 1.0" <> ")" }
40+ (spy "fuck" set) { opacity: if toggled then 0.7 else 0.9, transform: "scale3d(" <> if toggled then "0.9, 0.9, 1.0" else "1.0, 2.0, 1.0" <> ")" }
4241 pure mempty
4342 pure
4443 $ fragment
4544 [ animatedDiv
46− { style: css springStyles
45+ { style: css style
4746 , children: [ jsx box {} [ R.text "Click the button" ] ]
4847 }
4948 , R.button { children: [ R.text "Toggle" ], onClick: handler_ (modifyToggled not) }
@@ -54,7 +53,7 @@ mkDragAnimated = do
5453 box <- Box.makeComponent
5554 useStyles <- makeStylesJSS $ jssClasses \t -> { div: { width: "200px", height: "200px", background: "hotpink" } }
5655 component "Draggable Example" \{} -> React.do
57− springStyles /\ set <- useSpring $ const { x: 0.0, y: 0.0 }
56+ { style, set } <- useSpring $ const { x: 0.0, y: 0.0 }
5857 classes <- useStyles {}
5958 mkDragProps <-
6059 useDrag \{ down, movement: mx /\ my } ->
@@ -62,7 +61,7 @@ mkDragAnimated = do
6261 pure
6362 $ fragment
6463 [ animatedDiv
65− ( { style: css springStyles
64+ ( { style: css style
6665 , className: classes.div
6766 , children: [ jsx box {} [ R.text "Drag me somewhere" ] ]
6867 }