partial from render field
let x = List.hd(List.rev(self.state.nav.position)); | |
let x' = List.hd(self.state.nav.position); | |
... | |
<nav | |
className=(self.state.nav.isOpen ? "active" : "") | |
onClick=(event => ReactEventRe.Mouse.stopPropagation(event)) | |
style=( | |
self.state.nav.isSwiping^ ? | |
ReactDOMRe.Style.make( | |
~transform= | |
"translateX(" | |
++ string_of_float(x' -. x > 0.0 ? 0.0 : x' -. x) | |
++ "px)", | |
~transition="none", | |
() | |
) : | |
ReactDOMRe.Style.make() | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment