Created
May 22, 2019 16:39
-
-
Save ruucm-working/54717ec871a36bba8bd627b9f98a5c06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --- a/adidas-landing.framerfx/code/App.tsx | |
| +++ b/adidas-landing.framerfx/code/App.tsx | |
| @@ -8,6 +8,27 @@ export function Scroll(): Override { | |
| async onScroll(e) { | |
| var move = e.point.y | |
| log('move', move) | |
| + | |
| + if (showHeader && move < -50) { | |
| + showHeader = false | |
| + headerAnim.start({ | |
| + top: -100, | |
| + }) | |
| + } else if (showHeader == false && move > -40) { | |
| + showHeader = true | |
| + await headerAnim.start({ | |
| + top: 0, | |
| + }) | |
| + } | |
| }, | |
| } | |
| } | |
| + | |
| +var headerAnim | |
| +var showHeader = true | |
| +export function Header(): Override { | |
| + headerAnim = useAnimation() | |
| + return { | |
| + animate: headerAnim, | |
| + } | |
| +} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment