Skip to content

Instantly share code, notes, and snippets.

@persianturtle

persianturtle/app.re

Created Feb 15, 2018
Embed
What would you like to do?
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
You can’t perform that action at this time.