Тёмный

Build a Mask Cursor Effect With Nextjs and Framer Motion 

Olivier Larose
Подписаться 24 тыс.
Просмотров 30 тыс.
50% 1

A custom cursor with a mask hover effect revealing text underneath. Made with Nextjs and Framer Motion. Insipired by: minhpham.design/
Demo / Source code: blog.olivierlarose.com/tutori...
00:00 Intro
00:28 HTML and CSS
1:06 Creating the Mask
2:05 Getting the position of the mouse
3:19 Creating the cursor
5:03 Animating the size
5:29 Outro
More animations: blog.olivierlarose.com/
Follow me on Twitter: / olivierlarose_
Discord Channel: / discord
Thanks for watching!
#react #nextjs #awwwards #gsap #framer #motion

Опубликовано:

 

26 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 145   
@MinhPhamDesign
@MinhPhamDesign 9 месяцев назад
Hey Olivier, Great tutorial! I'm the designer who did the original site (well, I only designed it, not smart enough to code it lol). It's great to see how you nailed it so nicely!
@olivierlarose1
@olivierlarose1 9 месяцев назад
Hey Minh! Love your work, that's a super well designed website, I enjoyed remaking it. Love your videos btw! Keep it up
@Alex.Shalda
@Alex.Shalda 3 месяца назад
Awesome design! I saw your original video
@kranthisedamaki
@kranthisedamaki Год назад
I love the video style! The seemingly perfect audio transitions and no slow typing it out! It's great! Thank you!
@olivierlarose1
@olivierlarose1 Год назад
Thanks happy to hear that!
@ssan4777
@ssan4777 Год назад
amazing :) learning framer motion and learning alot from your tutorials. thank you so much olivier 🙏
@olivierlarose1
@olivierlarose1 Год назад
My pleasure🤝
@p3ter408
@p3ter408 11 месяцев назад
Broo that is so sick, I recently started coding in JS and theses kinds of videos are so inspiring. Keep up the work bro!
@olivierlarose1
@olivierlarose1 11 месяцев назад
Nice keep going bro👊
@istvantibortoth8395
@istvantibortoth8395 9 месяцев назад
Thanks so much Olivier! Your your videos are just what I've been looking for. Short, easy to understand and they help to spice up my simple designs 👍.
@olivierlarose1
@olivierlarose1 9 месяцев назад
Cheers!
@khaledx30ify
@khaledx30ify Год назад
always great topics never disappoint thanks brother
@olivierlarose1
@olivierlarose1 Год назад
Thanks for the support as always bro🙏
@akashctd03
@akashctd03 Год назад
Wow, bro this is both cool and incredibly helpful, tq for making such awesome videos 🙏
@olivierlarose1
@olivierlarose1 Год назад
My pleasure🤝
@oloyang431
@oloyang431 7 месяцев назад
Hi Olivier, great work! :D It's funny when in the end of the video you this was a very easy animation to do xD. Well, maybe for you ;). You should definitely create a tutorial on framer motion with your skills. There literally isn't an in depth tutorial on framer motion on the entire RU-vid. It would probably be the most viewed tutorial regarding framer-motion on RU-vid. Keep up the great work!
@ramin9134
@ramin9134 Год назад
amazing as always 👌
@olivierlarose1
@olivierlarose1 Год назад
Cheers my friend🤝
@pritamgain9504
@pritamgain9504 Год назад
perfect video for what I was looking for past couple of days... :)
@olivierlarose1
@olivierlarose1 Год назад
Nice!🔥
@aritrasarkar9374
@aritrasarkar9374 Год назад
Another great video by oliver
@olivierlarose1
@olivierlarose1 Год назад
Thank you🙏
@darkrager2000
@darkrager2000 11 месяцев назад
Super content bro, i learn new things by watching your every video. Keep rocking bro 😊
@olivierlarose1
@olivierlarose1 11 месяцев назад
Cheers🤝
@ndukachukz8067
@ndukachukz8067 Год назад
How can I be like you. I’m overwhelmed tbh. Simple, but creative. I love your skills ❤
@olivierlarose1
@olivierlarose1 Год назад
Practice makes perfect💯
@soyelchicodelanus8471
@soyelchicodelanus8471 Год назад
this guy is crazy! I love it! gracias!!
@olivierlarose1
@olivierlarose1 Год назад
🤝my pleasure
6 месяцев назад
Awesome, very inspiring !
@olivierlarose1
@olivierlarose1 6 месяцев назад
Cheers!
@rodrigosalmeron7216
@rodrigosalmeron7216 Год назад
Bro you are killing it ! Hacking all awwwards resources xD. Keep it going bro 🙌🙌🙌
@olivierlarose1
@olivierlarose1 Год назад
😂gotta reveal all the secrets! Thanks for the support🤝
@Diego_Cabrera
@Diego_Cabrera Год назад
Great video!
@olivierlarose1
@olivierlarose1 Год назад
Thx bro👊
@user-hf5vp4hg2i
@user-hf5vp4hg2i Год назад
You should make a video about your educational journey. I think it would be inspiring for a lot of people. It would defiantly be for me for sure 🙏
@olivierlarose1
@olivierlarose1 Год назад
Noted! ✍
@Sviatoslav-wv3qy
@Sviatoslav-wv3qy 4 месяца назад
If you try to repeat this animation, check your Framer Motion version. If it's 11.11 - 11.18( the last for the moment I write this comment), downgrade it to 11.10, otherwise it will lag. I spent around 5h trying to understand what's the difference between my code and his to eventually get that it's just Framer Motion's issue.
@zacmuturi4522
@zacmuturi4522 3 месяца назад
The specific version is 11.0.10 thanks a lot for the update, your 5hours were not wasted at all, you just saved me and potentially other peeps 5 or more hours..
@NachoGramajoFeijoo
@NachoGramajoFeijoo 3 месяца назад
Hi Zac, I downgraded the Framer Motion version but I the mask is not following the cursor until I stop moving it. The mask following the cursor animation is working kind of paused, do you know what it can be? @@zacmuturi4522
@rs844
@rs844 2 месяца назад
thanks man
@arjuntandon2711
@arjuntandon2711 Месяц назад
Thanks a lot for this comment. Been trying to get this working for so long . I even tried using motionvalues to do so but still was not able to see any result. I tested newer and latest versions but still this animation was laggy, so I had to downgrade to 11.0.10. Just curious , is there some other way achieve this animation in the latest versions?!
@mcmanimie
@mcmanimie Месяц назад
@@zacmuturi4522 Add me to that list.
@hassaantahir3861
@hassaantahir3861 Год назад
Quality content... 🔥
@olivierlarose1
@olivierlarose1 Год назад
Let’s goo🔥
@tamerahmed9860
@tamerahmed9860 6 месяцев назад
Thank you!
@olivierlarose1
@olivierlarose1 6 месяцев назад
You're welcome!
@ruizxzx
@ruizxzx Год назад
niceee one broo...checked this few days ago on your website demos
@olivierlarose1
@olivierlarose1 Год назад
Cheers👊
@mmaarafat
@mmaarafat 10 месяцев назад
Hi, bro. You are doing really great 👍
@olivierlarose1
@olivierlarose1 10 месяцев назад
Cheers👊
@majoralter
@majoralter Год назад
Great video
@olivierlarose1
@olivierlarose1 Год назад
Thanks!
@user-ii7xc1ry3x
@user-ii7xc1ry3x 9 месяцев назад
Olivier, you little genius.
@olivierlarose1
@olivierlarose1 9 месяцев назад
😂thanks
@Daddasoft
@Daddasoft Год назад
always creative 😎😎
@olivierlarose1
@olivierlarose1 Год назад
Let’s goo🔥
@sebosamuraj
@sebosamuraj Год назад
Nice job Bro :)
@olivierlarose1
@olivierlarose1 Год назад
Thanks :)
@user-yi3rq7jk2r
@user-yi3rq7jk2r 11 месяцев назад
i love it
@olivierlarose1
@olivierlarose1 11 месяцев назад
🤝
@ilmanmanarulqori5632
@ilmanmanarulqori5632 Год назад
Nowaaaaaaay here we go again 🎉🎉🎉🎉
@olivierlarose1
@olivierlarose1 Год назад
🔥🔥
@user-ci1su5ft3z
@user-ci1su5ft3z 9 месяцев назад
Obrigado ai amigo ótimo video continue postando video de framer-motion ou até quem sabe voce possa fazer videos de three.js tbm valeu
@leonardoalves6356
@leonardoalves6356 9 месяцев назад
Amazing video!! I just want to know how can I update the x and y position when I scroll as well?
@madhoundes
@madhoundes 2 месяца назад
such an awesome tutorial I was wondering can I develop this animation technique and implement it to be inside framer sites as compoment code override ?
@voldemortvi4264
@voldemortvi4264 11 месяцев назад
+Sub , simple and clean explaining & directly to the point , may i ask how long did take you to obtain this level of knowledge :D ?
@olivierlarose1
@olivierlarose1 11 месяцев назад
Thank you! Around 3-5 years, but it was scattered around many spheres of programming. If you focus solely on React and Front End I believe you can achieve this level within a year. Enjoy!
@rkcoder
@rkcoder Год назад
These are awesome! could you please make some of this kind of stuff using tailwind too?
@olivierlarose1
@olivierlarose1 Год назад
If there’s more demand for it I’ll definitely do it! Thanks for the suggestion 🙏
@imransefat8770
@imransefat8770 11 месяцев назад
+1 for tailwind
@jatiquep5543
@jatiquep5543 11 месяцев назад
Tailwind would be nice.... It would make things much easier to understand
@RahulSingh-wb3ne
@RahulSingh-wb3ne 8 месяцев назад
Loving it! thanks a ton for this tutorial Also is there a way to use this directly on Framer app?
@olivierlarose1
@olivierlarose1 8 месяцев назад
Good question! I know some people have integrated some of my animations inside Framer apps but personally I have no idea how to do that
@yukendhiran8043
@yukendhiran8043 6 месяцев назад
I was following this tutorial, when I scroll the effect disappear, if i use fixed for mask, the offscreen content got fixed, so how to make that effect persist like original site and how to use tailwind for this Thank you for your time and awesome tutorials
@feastofsteven1214
@feastofsteven1214 4 месяца назад
Thanks Olivier, great tutorial. I have the same question as the previous viewer - if I am using this on a number of components that make up the entire page (hero, about, work, etc.), how can I use this across all of those components/sections? As it is, if I add it to each section individually it acts very strange as you cross from one section to the next. Probably missing something simple on how to structure a page here.
@user-dp6vz9vw7c
@user-dp6vz9vw7c 17 дней назад
hey bro , i love your videos , i just incountered a problem while tryin to remake this animation , when i try to scroll the mask stops on following the mouse .
@matiasgigena1912
@matiasgigena1912 11 месяцев назад
Olivier whatsup, I would love a video on how denis does his navigation on his award winning portfolio. The way we do it, when you trynna navigate back to the home page, the preloader comesback. But in his version its like only when the components mount. Thank you!!! Also the page transitions would be great
@olivierlarose1
@olivierlarose1 11 месяцев назад
Hey absolutely! I'm waiting on a bug fix for exit animations in Next 13 and I will do just that. Stay tuned!
@fortunebolt
@fortunebolt 2 дня назад
This is nice!! Can this be used as a code override in framer?
@Faisal-np7qi
@Faisal-np7qi 11 месяцев назад
Hey Oli !! I love your videos (and thumbnails). thanks for the great content and for teaching us these cool animations) I wanted to ask about an issue I face with scrolltrigger when using next.js dynamic imports. It seems that dynamically importing components messes up the scrolltrigger position. I think it has to do with the component rendering before others and so its position changes? I am not sure. any ideas?
@olivierlarose1
@olivierlarose1 11 месяцев назад
Thanks for the support🙏 for ScrollTrigger, you could try to use the refresh() function to re-calculate or the immediateRender property. Hope that helps :)
@Faisal-np7qi
@Faisal-np7qi 11 месяцев назад
@@olivierlarose1 sounds good)) will we be seeing a new video soon? ^^
@olivierlarose1
@olivierlarose1 11 месяцев назад
I will release one tomorrow! You can also check my blog, I usually put the animation there before. Enjoy :)
@Faisal-np7qi
@Faisal-np7qi 11 месяцев назад
@@olivierlarose1 cant wait!
@samuelosei729
@samuelosei729 11 месяцев назад
You're so so good man!! How do you think of such solutions?
@olivierlarose1
@olivierlarose1 11 месяцев назад
Practice makes perfect💯
@user-fh7ik2jn5v
@user-fh7ik2jn5v 9 месяцев назад
oh my god
@olivierlarose1
@olivierlarose1 9 месяцев назад
🔥
@ryuske_edits
@ryuske_edits 4 месяца назад
hi olivier, could you please tell me how can I make it work if there is more than one paragraph in multiple sections, and I want the same cursor to reveal the hidden all paragraphs like it is in the original website.
@Sviatoslav-wv3qy
@Sviatoslav-wv3qy 4 месяца назад
I am not Oli, but you can try to make basically 2 identical pages with the content on the same place and use this effect to reveal a hidden content. Or use this effect only on the sections you need. So you will have something like: export function MaskComponent({hiddenContent, displayedContent}: {hiddenContent: ReactNode, displayedContent: ReactNode}) { {hiddenContent} {displayedContent} } And it doesnt matter how many paragraphs you have in the divs itself, it will reveal the hidden content anyway. Just make sure that they have +- the same size and markdown(position)
@FelipeChaves-wz4gp
@FelipeChaves-wz4gp 3 месяца назад
Good morning, what a cool and really good video, but it happened that I was trying to replicate it in my training application, and it seems that my animation is at 5 fps while in your code it is 60 haha, can anyone tell me what it could be ? I'm doing it with ts, the only glaring difference I see. (I have suspicions that the animation is only occurring when the mouse stops and not while it moves) ps: I'm very bad at English, sorry if there were considerable mistakes thanks in advance
@neon-gi5tb
@neon-gi5tb 6 месяцев назад
Hey great tutorial. I'm trying to recreate it with tailwind but I can't find the equivalent of mask-image property in tailwind, any idea what is it?
@olivierlarose1
@olivierlarose1 6 месяцев назад
It doesn’t exist in tailwind, but you can add some inline css in your jsx for the mask image property and it’ll work
@joshbillion6874
@joshbillion6874 Год назад
Can you make the same thing in html css and js + gsap ? Or you can point me in the right direction. Anyway amazing content. Really amazing.
@olivierlarose1
@olivierlarose1 Год назад
Join the react train my friend 🚂 but you can do the same using querySelectors, mouse move events and the gsap.to function. Best of luck!
@heeyfre4141
@heeyfre4141 11 месяцев назад
I looove this content. What path would you recommend to become an interactive web developer? I'm currently using Wordpress with theme builders and a little bit of code but I would really like to learn a js framework, gsap and so on but actually don't know where to start. I'm pretty good at HTML and CSS and know just the basics of JS, what would you suggest? I feel like I could replicate videos like yours and learn but maybe I'm missing the base to fully understand it? Maybe I should be super confident in JS and then React and then I would finally understand gsap and all crazy animations? or is there a faster way? Don't know if it makes sense but I'd love to learn a creative developer's perspective!
@olivierlarose1
@olivierlarose1 11 месяцев назад
There’s a lot of ways to do it. I would for sure leave wordpress for now because it’s going to limit you creativity wise. If you already have a good HTML and CSS base then I would jump in React and it’s going to deepen your understanding of JS at the same time. After you understand the basics of React then go for libraries like GSAP and Framer Motion, you can follow my videos it’s a good exploration of that and then try to make your own portfolio with your own creative animations. Then you can venture in webGL and you should be good to go.
@heeyfre4141
@heeyfre4141 11 месяцев назад
@@olivierlarose1 thank you for your answer. What do you think about trying to learn nextjs directly, instead of react. If you have any good online resource that would be really appreciated not only animations realted but also to give me an idea on how to deliver a project from start to finish. Your channel is one of a kind when it comes to cover this cool animations.
@olivierlarose1
@olivierlarose1 11 месяцев назад
@heeyfre4141 I suggest you start with vanilla React first then you’ll understand the pros and cons of using NextJs and other frameworks. For your first shipped website I would do it in Nextjs tho it’s going to be much easier for you since Vercel is super user friendly. But practice the basics of React first then go in Nextjs or any other frameworks for a released project
@sakibchowdhury7064
@sakibchowdhury7064 3 месяца назад
In next 14 I'm using your exact code but the mouse animation is laggy. Any solution?
@ZiaCodes
@ZiaCodes Год назад
WOW. I thought, it was gonna be sooo much coding and logic building but you simpliofied it way more. Would you mind cloning his website? 🙈 Something similar? I want to learn all the animations the website has? Is it possible?
@olivierlarose1
@olivierlarose1 Год назад
His website is really nice it would be hard work but I'll definitely remake it if I get more requests for it :)
@chokdeesam2365
@chokdeesam2365 Год назад
You have one more request :) we are many peoples ❤
@olivierlarose1
@olivierlarose1 Год назад
I hear you!
@ZiaCodes
@ZiaCodes Год назад
Thanks @@chokdeesam2365 Now you need to make video 🙈 @olivierlarose1
@rayhankessal6976
@rayhankessal6976 Год назад
👌🤔
@olivierlarose1
@olivierlarose1 Год назад
🤝🔥
@varunKT001
@varunKT001 7 месяцев назад
Hi, can you tell me how to handle the mouse position when scrolling? I don't want the mask to be animated, I just it stick to its position when scrolling. Just like it is Minh Pham's website.
@olivierlarose1
@olivierlarose1 7 месяцев назад
Try to put the cursor in position fixed
@labibnoob4732
@labibnoob4732 5 месяцев назад
@@olivierlarose1 how Please alot of people stucked
@araWINd-niqqa
@araWINd-niqqa 23 дня назад
im new to this instead of using a flex im using a relative and absolute layout when i tried to increase the height and width of the mask the whole layout gets collapsed
@araWINd-niqqa
@araWINd-niqqa 23 дня назад
can i keep the mask only to the container rather than the whole screen?
@richardpickman5574
@richardpickman5574 Год назад
Thumbnail is cringe, but content is great! Keep going, quality of the videos is sick!
@olivierlarose1
@olivierlarose1 Год назад
😅working on it
@julienheng3880
@julienheng3880 2 месяца назад
my cursor is pretty laggy ... do you happen to know why?
@Yourboss30
@Yourboss30 5 месяцев назад
IS THERE ANY WAY WE CAN MAKE THIS KINDA WEBSITE USING NO CODE OR IT IS NOT POSSIBLE YET
@olivierlarose1
@olivierlarose1 5 месяцев назад
You can with webflow I believe, but you’ll still want to add custom code for effects like this
@jheanbrizadao2429
@jheanbrizadao2429 5 месяцев назад
@user-yi3rq7jk2r
@user-yi3rq7jk2r 11 месяцев назад
can you clone website you show first in a play list ?
@olivierlarose1
@olivierlarose1 11 месяцев назад
Yes if there’s more interest for it I will rebuild it!
@user-yi3rq7jk2r
@user-yi3rq7jk2r 11 месяцев назад
@@olivierlarose1 thanks a lot , build a multipage website with aswome animation to gether with a page transition and maybe use react three fiber or threejs without any libary
@nihil_um
@nihil_um 9 месяцев назад
When i open devtools (in any browser), the animation doesn´t look smooth. Is this happening only to me?.
@moizahmed1898
@moizahmed1898 8 месяцев назад
same
@user-mo2po5xo4c
@user-mo2po5xo4c Год назад
I think u can rest sometimes, u already have so much content, man xD
@olivierlarose1
@olivierlarose1 Год назад
Haha I will😂
@joshuadodofoli6298
@joshuadodofoli6298 6 месяцев назад
How do you know all these things?
@olivierlarose1
@olivierlarose1 6 месяцев назад
Time!
@NomanAli-zd1bn
@NomanAli-zd1bn 22 дня назад
I am trying to create this with only Javascript but failed can anyone help me 😢
@Muhy_nz
@Muhy_nz Год назад
can you make tutorial make hover effect like 0:08
@olivierlarose1
@olivierlarose1 Год назад
Okk I hear you!
@Mirislomovmirjalol
@Mirislomovmirjalol Год назад
why this kind of things very easy to do but a lot of websites dont do it?
@olivierlarose1
@olivierlarose1 Год назад
Good question! I think it’s more of a design choice not really a technical problem
@nesmanpro
@nesmanpro 2 месяца назад
anybody else's mouse animation is lagging as hell with framer motion?
@misterrkuentin
@misterrkuentin 2 месяца назад
Yes, I know that it’s a workaround, but it works fine with the older version of framer-motion (10.14.0) and the newest Next.js 14.3
@alizaib.1
@alizaib.1 11 месяцев назад
and for the no. of components ? what can we do
@olivierlarose1
@olivierlarose1 11 месяцев назад
I'm not sure I understand your question :)
@alizaib.1
@alizaib.1 11 месяцев назад
@@olivierlarose1 I am asking that if we need to use this animation couple of times in our website than how can we do this
@alizaib.1
@alizaib.1 11 месяцев назад
@@olivierlarose1 Can you please create a vedio on this
@alizaib.1
@alizaib.1 11 месяцев назад
@@olivierlarose1 Like using context hook or redux etc .
@olivierlarose1
@olivierlarose1 11 месяцев назад
Gotcha! I’ll add it to my list and put out a video for this, stay tuned
@learncode5110
@learncode5110 Год назад
Amazing but its a suggestion please do not start with speed do step by step with coding explaination
@olivierlarose1
@olivierlarose1 Год назад
I usually speed up the parts I feel are not relevant to the animation, but thanks for your feedback🤝
@learncode5110
@learncode5110 Год назад
@@olivierlarose1 Okay!
Далее
My Top 5 Techniques for Web Animation
9:58
Просмотров 58 тыс.
CLANCY 🦞 Operation Squid Ink (New Animation)
00:58
Creating Custom Cursors - React and Framer Motion
13:50
5 Things I Learned in my Journey as a Developer
26:39
Staggered Text Animations with React and Framer Motion
11:59
Subtle, yet Beautiful Scroll Animations
5:04
Просмотров 1,6 млн
The Easy Way to Design Top Tier Websites
11:54
Просмотров 153 тыс.
UI Libraries Are Dying, Here's Why
13:28
Просмотров 286 тыс.
Award Winning Animation With Only 20 Lines Of CSS?
6:59