Hide Navigation on Page Scroll || Framer Motion useMotionValueEvent

  Рет қаралды 12,589

Tom Is Loading

Tom Is Loading

Күн бұрын

Animated UI components for React, Tailwind CSS, Framer Motion & More ✨ www.hover.dev
You know how you LOVE it whenever you're trying to just read an article on your phone/computer and half of the screen is taken up by the navigation?
Yea.
That's annoying.
This is exactly why many content sites, and even most phone operating systems, choose to hide any sort of navigation when they believe you're interacting with the page, for example while you're scrolling down!
Scrolling back up generally shows the navigation again as the user can now be thought of as disengaging from the content, thus they might want to check out another page of the site.
Today we'll learn how to implement this exact feature using React and Framer Motion, in the process learning about the useScroll hook and the useMotionValueEvent hook
🔗 My Links
My website (animated UI components for React): www.hover.dev
Dev portfolio templates: tomisloading.gumroad.com/
TikTok: / tomisloading
Instagram: / tomisloading
GitHub: github.com/TomIsLoading
Twitter: / tomisloading

Пікірлер: 39
@johnemmerechts3769
@johnemmerechts3769 4 ай бұрын
For typescript users, previous can be undefined (MotionValue.getPrevious(): number | undefined) First check if previous is defined : if (previous && latest > previous && latest > 150) { Thanks for the tuto :)
@sportseye7422
@sportseye7422 10 ай бұрын
Greatt greatt, I really like the easy and clear way that you explain. Keep it up.
@mdrifat6941
@mdrifat6941 11 ай бұрын
I am a Junior Web Developer and currently trying to learn what it takes to be an intermediate or senior one. For this reason, started exploring different animation libraries and selected Framer Motion for it. To sharpen the fundamentals, saw some tutorials and loved yours the most. So I have a request to you. Please make a playlist of Framer Motion where you will cover all the topics to understand from the basics to the advanced. Hope you will keep my request.
@tomisloading
@tomisloading 11 ай бұрын
Hey!! Thank you so much!! I have some videos planned to go deeper into the specifics which I’ll absolutely get to soon :) thanks for the input, I genuinely appreciate it 😁😁
@maciejmyslinski7820
@maciejmyslinski7820 5 ай бұрын
Amazing work! Thanks a lot for this content.
@pikusionexio
@pikusionexio 11 ай бұрын
It really is that easy, huh? Thank you for the quick tutorial, much appreciated!
@tomisloading
@tomisloading 11 ай бұрын
Happy it helps! :)
@Adventures_English
@Adventures_English 4 ай бұрын
Fantastic video thanks a ton. New fan
@s4chin_verma
@s4chin_verma 6 ай бұрын
Amazing video sir it helps me a lot in my portfolio website
@janira98
@janira98 10 ай бұрын
Yah that was the one I was looking for 👌
@nathannelson5645
@nathannelson5645 7 ай бұрын
Appreciate this FREE knowledge bro!
@tomisloading
@tomisloading 7 ай бұрын
Happy I can help! :)
@usamariaz3765
@usamariaz3765 11 ай бұрын
Amazing thank you keep providing us great content 🤩🤩🎉
@tomisloading
@tomisloading 11 ай бұрын
Thank you!!! I’ll try my best haha 😁😁😁
@wibbs88
@wibbs88 8 ай бұрын
Works great - Thanks! However when I add a Hero with absolute position (top-0) I find the scroll up only reveals the nav for the screen height - If i scroll way down then back up it doesn't appear. If I remove the absolute positioning from the hero image then it works fine.
@es20x
@es20x 11 ай бұрын
great tutor ❤
@katerinadesrosiers
@katerinadesrosiers 7 ай бұрын
Thank u!!
@developedbymighty
@developedbymighty 5 ай бұрын
Amazing tutorial
@tomisloading
@tomisloading 5 ай бұрын
Thank you! :)
@gaborlakatos882
@gaborlakatos882 5 ай бұрын
Nice
@Equilibrium543
@Equilibrium543 11 ай бұрын
Great Video
@tomisloading
@tomisloading 11 ай бұрын
Thank you!! :)
@honefone
@honefone 11 ай бұрын
niceee
@studyafa7159
@studyafa7159 10 ай бұрын
Great
@elmiur
@elmiur 3 ай бұрын
Just do it in plain js or using useEffect with react, framer motion is an over kill.
@ChandanKumar-ps3cz
@ChandanKumar-ps3cz 6 ай бұрын
Awsommmmmmmmmm
@user-vk8ri5ks5c
@user-vk8ri5ks5c 3 ай бұрын
I tried to break this out into a component like and just pass children through, but then the animation stops working, only the show and hiding works but it's very abrupt. Do you know why this happens and how to fix it?
@user-vk8ri5ks5c
@user-vk8ri5ks5c 3 ай бұрын
Nevermind I must have messed up the first time I tried, I got it working!
@katerinadesrosiers
@katerinadesrosiers 7 ай бұрын
I found the tutorial super easy! But the part of latest > 150 doesn't work as it should, with or without it, the nav appears at the same delay :(
@RishiKasyap
@RishiKasyap 7 ай бұрын
that only works when it is at the top, 150 is the distance from the top
@navinkumarsahu1159
@navinkumarsahu1159 9 ай бұрын
great
@tomisloading
@tomisloading 9 ай бұрын
Thank you!
@izusaE
@izusaE 7 ай бұрын
Which is your version of framer-motion in your package.json ? I have this error with useMotionValueEvent : "framer-motion"' has no exported member named 'useMotionValueEvent'. Did you mean 'useMotionValue'
@tomisloading
@tomisloading 7 ай бұрын
Should be latest!
@izusaE
@izusaE 7 ай бұрын
@@tomisloading So fast ! I'm with the latest (yarn add framer-motion@latest so I have ^10.16.16) I'm gonna see why I have this error :/ But your tutorial is super cool !
@tomisloading
@tomisloading 7 ай бұрын
@@izusaE odd 🤔 just double checked the docs, it’s definitely not deprecated or anything like that. useMotionValue is a hook as well though 🤷‍♀️
@izusaE
@izusaE 7 ай бұрын
@@tomisloading I resolve it by uninstall the folder nodes_modules ! It works well ! Thank you a lot for this tutorial !
@tomisloading
@tomisloading 7 ай бұрын
@@izusaE heck yea!! Happy I could help :)
@cosasdereddit111
@cosasdereddit111 10 ай бұрын
gooooooooooooooooooooooooooooooooooooooooodddddddddddddddddddddddddddddddddd
The Framer Motion Crash Course || React Animation Library 2023
52:36
Tom Is Loading
Рет қаралды 90 М.
Auto-hiding Sticky Navigation With Framer Motion In 10 Minutes
13:07
Frontend FYI – by Jeroen
Рет қаралды 5 М.
🤔Какой Орган самый длинный ? #shorts
00:42
Alex hid in the closet #shorts
00:14
Mihdens
Рет қаралды 15 МЛН
Secret Experiment Toothpaste Pt.4 😱 #shorts
00:35
Mr DegrEE
Рет қаралды 30 МЛН
Build a Side Navigation with TailwindCSS and Framer Motion
16:27
Complex Animations with Framer Motion & React || useAnimate Hook
13:48
Staggered Animations in React with Framer Motion in 5 Minutes
5:29
Leigh Halliday
Рет қаралды 38 М.
Beautiful Animated Nav Bar with React & Framer Motion
11:39
Tom Is Loading
Рет қаралды 10 М.
Animated tabs - with inverted text!
12:15
Sam Selikoff
Рет қаралды 55 М.
5 MORE TailwindCSS Tips I Wish I Learned Earlier
5:32
Tom Is Loading
Рет қаралды 12 М.
Framer Update: Scroll Transforms
17:07
Framer
Рет қаралды 118 М.
Layered Parallax Scroll with React & Framer Motion
12:46
Tom Is Loading
Рет қаралды 44 М.
Samsung laughing on iPhone #techbyakram
0:12
Tech by Akram
Рет қаралды 6 МЛН
Лучший браузер!
0:27
Honey Montana
Рет қаралды 440 М.