Last active
October 9, 2022 08:34
-
-
Save perrysmotors/7154f31cf957f8f021d0444af7cab021 to your computer and use it in GitHub Desktop.
Transform the height of a layer as you scroll in Framer X
This file contains 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
import { Override, motionValue, useTransform } from "framer" | |
const contentOffsetY = motionValue(0) | |
// Apply this override to your scroll component | |
export function TrackScroll(): Override { | |
return { contentOffsetY: contentOffsetY } | |
} | |
// Apply this override to your app bar | |
export function AppBar(): Override { | |
const height = useTransform(contentOffsetY, [0, -52, -52], [140, 88, 88], { | |
clamp: false, | |
}) | |
return { | |
height: height, | |
} | |
} |
Ah works now! Thank you!
best,
Bill
…On Jun 5, 2019, 12:29 AM -0700, Giles Perry ***@***.***>, wrote:
I took a look at your file... You had the wrong override applied to the StickyScroll component. You need to use TrackScroll.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I took a look at your file... You had the wrong override applied to the StickyScroll component. You need to use TrackScroll.