How to Make Page Transitions using Next.js and GSAP

  Рет қаралды 26,519

Olivier Larose

Olivier Larose

Күн бұрын

Пікірлер: 89
@olivierlarose1
@olivierlarose1 8 ай бұрын
When using GSAP in production, you might have FOUC (flash of unstyled content) , you can avoid that by adding an initial CSS value like opacity: 0. You can read more here: gsap.com/resources/fouc/
@alvarobyrne
@alvarobyrne 8 ай бұрын
I am a beginner, just took part of one react (native) project and (as you may see for what I am about to say never did nextjs work) it surprises me that nextjs doesn't provide (never better said) a global context! Very well done! Note for self: `Component` (arg of `App`) has a `key` prop
@TheRealG-yt9yj
@TheRealG-yt9yj 8 ай бұрын
SIR THANK YOU VERY MUCH . as a beginner we have so many doubts and stuff . The way your content helps is just NEXT LEVEL . THANK YOU . 😊😊
@flavioczuk
@flavioczuk 2 ай бұрын
Brooooo you´re a legend!!! I´ve stumbled upon the link you´ve mentioned on the video by John Polacek but I was having a hard time understanding everything... With your explanation everything is now crystal clear and I was able to update my project and implement everything that way I had planned! Thank you very much and keep up the awesome work!!!!
@wailokwang
@wailokwang 8 ай бұрын
Olivier, thanks for your vids. I just wanted to mention that the Next.js team doesn't seem to care about page transitions on app routes, even though it's been released since Next.js 13 (and since you started uploading videos). Lol.
@elcho007
@elcho007 8 ай бұрын
Simply no words for the quality of your content, hats off to you. You are a true gem!! Thank you.
@olivierlarose1
@olivierlarose1 8 ай бұрын
Cheers, I appreciate it
@lThePotatoCrew
@lThePotatoCrew 7 ай бұрын
If only this worked with app router :(. Great work though, your explain everything very well!
@zjebinsky
@zjebinsky 7 ай бұрын
Just discovered your channel. This is golden!!
@TheBorninmotion
@TheBorninmotion 8 ай бұрын
wow amazing example ! Please make more tuts using nextjs page router and gsap, keep up !
@edojoshua
@edojoshua 8 ай бұрын
Great work as always Oli!
@MrJfergs
@MrJfergs 8 ай бұрын
I think you are one of the best Creative UI devs on KZbin if not the entire internet. Thank you for your content, I wanted to ask if you are from France? It seems that many of the devs within this niche are from France or Quebec. Merci beaucoup pour votre travail. I wanted to ask if this transition will be using the Pages or App router in next.js?
@olivierlarose1
@olivierlarose1 8 ай бұрын
I’m from Montreal, Quebec yes and this page transition is with the page router only
@MrJfergs
@MrJfergs 8 ай бұрын
@@olivierlarose1 Nice, I ma actually not too far from Montreal myself. I have yet to find a good solution for page transitions using the app router yet.
@dewann99
@dewann99 8 ай бұрын
If the "sleeper build" was a channel.
@kevyyar
@kevyyar 8 ай бұрын
What you mean
@tatyabicchu21
@tatyabicchu21 8 ай бұрын
Totally agree
@mateuspaula_dev
@mateuspaula_dev 7 ай бұрын
Thanks for this content buddy, all the best for you always!!
@olivierlarose1
@olivierlarose1 7 ай бұрын
Cheers bro
@funstationatlanta
@funstationatlanta 6 ай бұрын
This is amazing! great work.
@nellymotion
@nellymotion 8 ай бұрын
so much good information, thank you
@seanzhang3873
@seanzhang3873 6 ай бұрын
This is great, but can you make a tutorial on Framer Motion with Next.js 13+, using the new app router. I am struggle to create transition out animation and cannot find much resource on this.
@BharatBhandari-s5i
@BharatBhandari-s5i 7 ай бұрын
Awesome explanation, can you please also suggest a way to add Intro animation in nextjs Page Router
@rohitpandey4411
@rohitpandey4411 7 ай бұрын
your video is awesome, and your name is weird olivier. Thanks its a very simple implementation with good instincts
@devwithzain
@devwithzain 8 ай бұрын
Preloader animation olivier please 🙏
@olivierlarose1
@olivierlarose1 8 ай бұрын
Noted!
@thisissahaj
@thisissahaj 8 ай бұрын
You can find a small bit of it in the 2nd video of his playlist..Vid - "Rebuilt Awwwards Website..."
@shivkumar6374
@shivkumar6374 8 ай бұрын
Loved to see your videos
@ridwanajibola3038
@ridwanajibola3038 21 күн бұрын
Thanks a lot for this.
@olawanletemitayo2174
@olawanletemitayo2174 8 ай бұрын
Goated video as always ✨🎉
@electroheadfx
@electroheadfx 8 ай бұрын
amazing man, thanks for the tip
@TomaszOstroga
@TomaszOstroga 8 ай бұрын
Your content is always top-notch! Thank you. Could you elaborate on why that approach is not supported on the app router, please?
@brittonwalker7341
@brittonwalker7341 2 ай бұрын
How would you approach this if you wanted the entry animation to animate in before the old content exits? For example, have the new content swipe up over the old content and then handle the removal of the old content?
@marcelsdev
@marcelsdev 7 ай бұрын
Ever thought of using or replacing GSAP with Framer Motion? Only reason I don't use GSAP for products is because some library features are priced and I can replicate them using Framer Motion. Your thoughts?
@marcelsdev
@marcelsdev 7 ай бұрын
Nevermind... I see you use Framer Motion on other projects 😄 Great content! 🦾
@AntTheOne777
@AntTheOne777 7 ай бұрын
Hey! When will your online courses be accessible? Amazing work btw.
@fokspoks
@fokspoks 3 ай бұрын
but how nextjs doesn't ask you to add 'use client' in places where you use hooks?
@jjuuiiccyyjj
@jjuuiiccyyjj 8 ай бұрын
thanks for this!
@thomasfichtner9738
@thomasfichtner9738 3 ай бұрын
Hey is there a way to make the animation mode sync. like play exit and enter animation simultaneously
@stoggys
@stoggys 7 ай бұрын
Great stuff!
@hrsikeisa
@hrsikeisa 8 ай бұрын
Man wat camera do you use ? your videos are really sharp !
@olivierlarose1
@olivierlarose1 8 ай бұрын
I use my Iphone haha
@dmnkb
@dmnkb 8 ай бұрын
For a real live project using Next.js would you rather recommend Framer Motion or GSAP?
@olivierlarose1
@olivierlarose1 8 ай бұрын
Either is fine, but personally I would use Framer Motion
@eduardaskuliesa8308
@eduardaskuliesa8308 7 ай бұрын
I have created page transitions with custom Links, and they have entry and exit animations. Everything works fine, but I don't get it why this is wrong ?
@ninjagaskin
@ninjagaskin 5 ай бұрын
Any idea when this would be useful for app router next js?
@xberna8156
@xberna8156 8 ай бұрын
Amazing!
@spacemanXVI.
@spacemanXVI. 5 ай бұрын
🔥🔥🔥🔥
@joostschuur
@joostschuur 8 ай бұрын
When it comes to page animations, does GSAP have any advantages over Framer Motion or vice versa?
@olivierlarose1
@olivierlarose1 8 ай бұрын
No the final result is quite similar. I would say Framer Motion has a faster and cleaner implementation and in my experience GSAP has some FOC problems that you need to manage.
@MARSTEE-official
@MARSTEE-official 8 ай бұрын
Nice video. It’s possible in App Router with templates. (Layouts x templates).
@PaperKrane
@PaperKrane 8 ай бұрын
I wanted to say that too. Kind of confused as to why he claims it's 'hacky' by using onClick={} on top of a Next Link component.
@Ss-zg3yj
@Ss-zg3yj 7 ай бұрын
Not possible
@electroheadfx
@electroheadfx 8 ай бұрын
did you already apply for Next with app version ?
@KaluKarKK
@KaluKarKK 8 ай бұрын
Am I mistaken, or you can use template on the app router for page transition!! 🙁
@devwithzain
@devwithzain 8 ай бұрын
Yes kzbin.info/www/bejne/jJ-1dGuGrt91iposi=fNV-NVm7_0pNIuRR
@olivierlarose1
@olivierlarose1 8 ай бұрын
I saw this video, and like I said in the beginning of the video, I am not comfortable using this approach for a client, as it overrides the Link component with a button and an on click event, which is not good for SEO and accessibility.
@jheanbrizadao2429
@jheanbrizadao2429 8 ай бұрын
@liamrahimian1588
@liamrahimian1588 4 ай бұрын
Add a route outside your header and the route will stop working because of the transition component.
@quebuena111
@quebuena111 5 ай бұрын
And why the page router, that’s old stuff
@puturangga2024
@puturangga2024 7 ай бұрын
Can you make it again but using motion framer?
@monarchgam3r
@monarchgam3r 8 ай бұрын
This solution is kinda old and only works with pages router, unless it’s an old or already existing project, app is just better to use and recommended, unfortunately there doesn’t seem to be a way to do page transitions with app router
@olivierlarose1
@olivierlarose1 8 ай бұрын
Page router gets a lot of hate for nothing haha, it still works fine for presentation type websites
@Ss-zg3yj
@Ss-zg3yj 7 ай бұрын
@@olivierlarose1 you know there's people building something else but useless awwards shitty agency websites no one using, right?
@fiha_khair_yt
@fiha_khair_yt 8 ай бұрын
I'm still waiting for web course😅❤
@olivierlarose1
@olivierlarose1 8 ай бұрын
Coming soon! Working on new modules including shaders and complex animations
@fiha_khair_yt
@fiha_khair_yt 8 ай бұрын
@@olivierlarose1 Thank you ❤
@bhuvya11
@bhuvya11 8 ай бұрын
Chad video 💯💯
@DuBritoo
@DuBritoo 7 ай бұрын
what’s your webcam?
@CodeCraftersStudio
@CodeCraftersStudio 6 ай бұрын
Plesse update this with app router Thankyou in advance
@roguegoblin2407
@roguegoblin2407 8 ай бұрын
hey oli! sent you a discord dm with a way to these transitions in nextjs with app router :)
@olivierlarose1
@olivierlarose1 8 ай бұрын
Hey man, thanks for the ressource. Unfortunately, you’re doing it in one of the two ways I described in the beginning of the video (page transition with an on click on a button), which is not good for SEO and accessibility. I personally would not feel comfortable using that in production for a client. As of now, if I want a page transition, I use the Page router, which still works fine for presentation websites. Cheers
@roguegoblin2407
@roguegoblin2407 8 ай бұрын
@@olivierlarose1 ohh didnt realize that was what you meant, I thought you meant a literal button, sorry!
@alexnjagi3169
@alexnjagi3169 7 ай бұрын
🤔I wouldn't recommend saving children components to the state, it might raise performance concerns for large component trees. Instead of using the state to listen for children changing, can't we just use `Router. events` from next js, and anytime we move to another page, we can perform some action.
@olivierlarose1
@olivierlarose1 7 ай бұрын
I agree with you, but a problem I see with using router events is we wouldn’t have control over the displaying of the pages, so I don’t see how we could delay the page transition to leave space for the exit animation
@ayoubdev8019
@ayoubdev8019 8 ай бұрын
First viewer first comment , nice video oliv
@olivierlarose1
@olivierlarose1 8 ай бұрын
Cheers bro
@Ss-zg3yj
@Ss-zg3yj 7 ай бұрын
Pages router...USELESS!
@jason.zubiate
@jason.zubiate 5 ай бұрын
you can do this with a template.tsx file. check next docs. basically what he's making
@Ss-zg3yj
@Ss-zg3yj 5 ай бұрын
@@jason.zubiate there's no exit transition in App Router, you 🤡
@StephenRayner
@StephenRayner 8 ай бұрын
Meh page router…
@PaperKrane
@PaperKrane 8 ай бұрын
You can do page transitions with app router as well using templates.
@olivierlarose1
@olivierlarose1 8 ай бұрын
Send me a link! Would be surprised if it does not fall in either one of the two categories I mentioned in the intro
@Ss-zg3yj
@Ss-zg3yj 7 ай бұрын
@@PaperKrane no you can't
@PaperKrane
@PaperKrane 7 ай бұрын
​@@Ss-zg3yj Lol I wrote an entire message on this chain of how you *can* but it looks like the channel creator deleted it because it disproves his point. Research Next.js 'templates' that are rendered inside of layout.js. You can create an animation in and build your own Next.js Link component that just ads an animation on the outro and then uses Next.js router to push the next page. I have apps in production with this but hey, if you want to live in a bubble and believe it isn't possible, that is A-OK with me.
@Ss-zg3yj
@Ss-zg3yj 7 ай бұрын
@@PaperKrane templates has BROKEN exit transitions. what are you talking about? you have problems with your vision?
2 Ways to Make a Magnetic Effect using Framer Motion, GSAP and Nextjs
6:54
Next.js Template vs Layout with Page Transition Animations
17:19
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 103 МЛН
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 7 МЛН
Don't underestimate anyone
00:47
奇軒Tricking
Рет қаралды 24 МЛН
Creating Sick Page Transitions with Barba.js & GSAP
20:05
DesignCourse
Рет қаралды 136 М.
My Top 5 Techniques for Web Animation
9:58
Olivier Larose
Рет қаралды 108 М.
5 Things I Learned in my Journey as a Developer
26:39
Olivier Larose
Рет қаралды 8 М.
One Simple Step to Add Page Transitions in NextJS
8:39
Ankita Kulkarni
Рет қаралды 8 М.
I DONT USE NEXT JS
54:01
ThePrimeTime
Рет қаралды 377 М.
5 Ways to Make Gradients on the Web
6:38
Olivier Larose
Рет қаралды 10 М.
NextJS Page Animation Transitions with GSAP
8:13
rithmic
Рет қаралды 27 М.
Creating an award-winning page transition in Webflow using GSAP
14:45
How To Choose Mac N Cheese Date Night.. 🧀
00:58
Jojo Sim
Рет қаралды 103 МЛН