You Need This Hover Effect on Your SVGs ASAP (ReactJS / TailwindCSS)

  Рет қаралды 69,406

rithmic

rithmic

Күн бұрын

Пікірлер: 120
@iamrithmic
@iamrithmic 8 ай бұрын
You can find me on Twitter / X: twitter.com/rithmio
@MeekoEdits
@MeekoEdits 8 ай бұрын
Just a small remark - saving high velocity data into state, such as cursor position, will result in rather unpleasant performance because of the constant barrage or re-renders whenever you move your cursor. I personally would go with either setting those SVG attributes directly via JS in handleMouseMove or I’d use Framer Motion. Also getBoundingClientRect is kinda expensive and doing it in a mouse move handler will slow the whole thing down considerably. It’d be better to cache it (in a ref for example) and use it from there, since it doesn’t change that often…if ever.
@darshandev1754
@darshandev1754 8 ай бұрын
agreed
@Pixelaze
@Pixelaze 9 ай бұрын
I'm calling it now, this channel is gonna blow up. Quality content.
@iamrithmic
@iamrithmic 9 ай бұрын
Woah! Thank you!
@vinitgupta1648
@vinitgupta1648 9 ай бұрын
I just saw this one video and I agree 💯
@jamesonb5075
@jamesonb5075 9 ай бұрын
I usually don't find youtube content useful, at all.. Buut.. This was very informative and straight to the point, it gets a thumbs up from me, well done!
@iamrithmic
@iamrithmic 9 ай бұрын
Im really glad this was of use. Thanks for the comment!
@NIXO3D
@NIXO3D 9 ай бұрын
This tutorial is GOLD. Thank you for sharing. 🍻
@iamrithmic
@iamrithmic 9 ай бұрын
Glad you found it useful :)
@ardipranata6631
@ardipranata6631 8 ай бұрын
This channel is a national treasure fr, good & quality content
@iamrithmic
@iamrithmic 8 ай бұрын
Appreciate those word
@neoney
@neoney 9 ай бұрын
Would be nice if there was a constant preview of the browser window next to the code as you're adding classes, so it's easier to remember what which class does
@iamrithmic
@iamrithmic 8 ай бұрын
Will be trying this in future videos
@thehelldesk5463
@thehelldesk5463 8 ай бұрын
Thx for the share you gain one more subscriber. Great quality content.
@iamrithmic
@iamrithmic 8 ай бұрын
Thanks for the sub! Appreciate that a lot
@mcstephen
@mcstephen 8 ай бұрын
You just got a new follower
@iamrithmic
@iamrithmic 7 ай бұрын
Thank you!
@sandercafe
@sandercafe 8 ай бұрын
Wow, simple and beauty! thx!
@iamrithmic
@iamrithmic 8 ай бұрын
Glad you like it!
@thenightwolf224
@thenightwolf224 9 ай бұрын
AMAZING KEEP GOING BUDDY
@iamrithmic
@iamrithmic 9 ай бұрын
Thank you for the support!
@edt34
@edt34 8 ай бұрын
love it! thank you for this
@iamrithmic
@iamrithmic 8 ай бұрын
You're so welcome!
@carlosmorales8237
@carlosmorales8237 7 ай бұрын
Amazing, i have been wanting to do this effect for a while, thanks
@ericnemo8348
@ericnemo8348 9 ай бұрын
Very nice ! Thanks for sharing !
@iamrithmic
@iamrithmic 9 ай бұрын
Thanks for watching!
@Stephinmaju
@Stephinmaju 9 ай бұрын
Absolutely gorgeous 🥰
@iamrithmic
@iamrithmic 9 ай бұрын
Thank you!
@dinoDonga
@dinoDonga 8 ай бұрын
Somewhat reminds me of @Hyperplexed. Straigt up to the point and visually pleasing. Great stuff no pressure just keep doing your thing
@iamrithmic
@iamrithmic 8 ай бұрын
One of my biggest inspirations on YT. Comment means a lot!
@msahu2595
@msahu2595 9 ай бұрын
Love the video ❤😍😘
@iamrithmic
@iamrithmic 9 ай бұрын
Thank you!
@sid4579
@sid4579 9 ай бұрын
Jeeez the quality
@iamrithmic
@iamrithmic 9 ай бұрын
Thanks! Trying to improve with each video
@marcusalx
@marcusalx 8 ай бұрын
It's pronounced "veet"! :) Nice video!
@iamrithmic
@iamrithmic 8 ай бұрын
🤦‍♂️
@diogosoares1309
@diogosoares1309 6 ай бұрын
Masterclass 👏
@SolidWorksMastery-hr4sg
@SolidWorksMastery-hr4sg 7 ай бұрын
Thanks for the video it's great .... i was trying to replicate also the effect on the 'supabase' website in the "edge function" card the effect that look like an electricity passed or something ... i also see it in vercel website it's so nice but i think i should learn more on animation and svg before i can make it
@michaelkurzewski2937
@michaelkurzewski2937 8 ай бұрын
This could be great for bento box gradient borders. Just create svgs wrappers with composed children inside. I think it's just a bit of calculating for it to be dynamic size
@r4rbit
@r4rbit 8 ай бұрын
I've been wanting to share what I've learned through KZbin videos too but never find the courage to do so. What did motivate you to post videos like this one? You make it look easy, great job! This was very informative and enjoyable 👍🏻
@Sammysapphira
@Sammysapphira 8 ай бұрын
I smell a new web design trend
@farzadmf
@farzadmf 9 ай бұрын
Really cool! Would be nice if you shared the code in a repo or something
@iamrithmic
@iamrithmic 9 ай бұрын
Thanks man, lol yeah will be adding it!
@farzadmf
@farzadmf 9 ай бұрын
Great, thank you!
@iamrithmic
@iamrithmic 9 ай бұрын
It's there mate :)
@farzadmf
@farzadmf 9 ай бұрын
Great!
@DomskiPlays
@DomskiPlays 8 ай бұрын
Really cool!
@mohitashliya8750
@mohitashliya8750 9 ай бұрын
Finally some good knowledge using tailwind
@r-i-ch
@r-i-ch 9 ай бұрын
This is a great effect and code explanation but I can’t help but feel it is a messy mix of techs and concerns. I think taking Tailwind out of the equation could clear things up. Ditto for using pure JS instead of react states. (Ex. You could activate the svg border with a :hover pseudo-class) Still. Hella cool.
@iamrithmic
@iamrithmic 8 ай бұрын
I should have stated, i think supabase also uses tailwind on their landing page. But thank you :)
@r-i-ch
@r-i-ch 8 ай бұрын
@@iamrithmic Well then it looks like I gotta have a talk with someone at Supabase 😁 That's the nature of Dev - plenty of ways to do the same thing. (Plus I will always admit to disliking Tailwind) I'll have to find, I think Kevin Powell did something like this in pure CSS maybe🤔. To be continued... Thanks again for great work and inspiration.
@YashTiwari.official
@YashTiwari.official 9 ай бұрын
Hey brother please start a series on Three js you are amazing on that ❤🎉
@NekoujiTV
@NekoujiTV 8 ай бұрын
hmm... it possibly do same effect on text overlay?
@beehivenetwork2099
@beehivenetwork2099 7 ай бұрын
Ok, thanks a lot. Now, how do I build it in plain JS?
@K조셉
@K조셉 9 ай бұрын
good tuto brother , but i have a question : how do i deal with big svg in nextjs
@iamrithmic
@iamrithmic 9 ай бұрын
Thank you! The same way, however I would keep an eye out on the viewbox property with SVGs etc. You may have to play around with some values, however the principle shown in this vid would be the same
@HarshilChaurasiya
@HarshilChaurasiya 8 ай бұрын
which extension do you use for that equal sign and arrow sign??
@ralusek
@ralusek 8 ай бұрын
Here's what I'd change: 1.) This is just semantic, but I'd change the interface of the Flame component to be more agnostic about what is determining where it draws the gradient. Sure, it could be the cursor, but it could also be animated for another reason. Just have it accept gradientCenterX and gradientCenterY rather than implying it should have to do with cursor. Likewise, rather than accepting mouseOnCard prop, which makes it now have assumptions about its parent and where the Flame component will be used, it'd make more sense to just have it have a prop called showGradient 2.) Rather than having gradientCenter/setGradientCenter and the accompanying useEffect inside of Flame, if there's a calculation like that that you need to do, just replace both with a useMemo.
@varunchakraborty6020
@varunchakraborty6020 8 ай бұрын
relatively new in this field and kinda confused of memoization stuff, but what's the point of memoization of the result when cause of animation keeps on changing and so does the input to calculations?
@ralusek
@ralusek 8 ай бұрын
@@varunchakraborty6020 He's currently running it in a useEffect hook which is also reacting to the changed input. useMemo is just taking his useState/useEffect and combining them to a more semantically correct representation of his goal. With regards to why you'd memoize in the first place, you're right that the input here will change frequently enough such that many of these cases in which it would be memoized will trigger a rerun for a changed input, but there are plenty of times which react might call a re-render with the input having been unchanged. For example, as a user is typing something, they're not moving the cursor but the renders are happening, this memoization would hold in those cases. React also often renders a few times while squaring away its render state with some other underlying state, and those redundant renders need not recalculate the effect, as the cursor will also have the same position in those cases. But in general, I'd say your intuition is on the right track.
@holypizza1
@holypizza1 8 ай бұрын
How come that I never discovered your channel before?
@TenzDelek
@TenzDelek 6 ай бұрын
i believe this could be done in an easier way using framer motion
@_BonsaiBen
@_BonsaiBen 8 ай бұрын
you should see Vercel's 2024 annual conference page...!!!!
@iamrithmic
@iamrithmic 8 ай бұрын
A thing of beauty
@daleryanaldover6545
@daleryanaldover6545 8 ай бұрын
vight innit 😭
@iamrithmic
@iamrithmic 8 ай бұрын
😂 forever conscious of this. was just waiting for someone to pick this up
@stevebendersky2056
@stevebendersky2056 5 ай бұрын
What about responsiveness?
@febrisapermana
@febrisapermana 9 ай бұрын
what theme do you use in your VSCode ?
@itszbari
@itszbari 9 ай бұрын
Look like material ocean dark (material community theme)
@iamrithmic
@iamrithmic 9 ай бұрын
Correct :)
@achirasilva2567
@achirasilva2567 3 ай бұрын
Can we get this effect on a button too?
@ariphharts
@ariphharts 8 ай бұрын
Why does this feel like Hyperflex's style
@iamrithmic
@iamrithmic 7 ай бұрын
My favourite KZbin channel. A lot of inspiration from him
@SjarMenace
@SjarMenace 8 ай бұрын
How do you know all this code out of your head dang
@AjaySingh-jz8qx
@AjaySingh-jz8qx 8 ай бұрын
Amazing
@Stephinmaju
@Stephinmaju 9 ай бұрын
What is the Name of the code theme?
@YassineDorgaa
@YassineDorgaa 8 ай бұрын
can i applied on card or something semilair to png .. etc
@iamrithmic
@iamrithmic 8 ай бұрын
Would have to be an SVG
@naylord5
@naylord5 9 ай бұрын
Sweet baby Jesus, you missed the NSFW tag here mate, this is too sexy 🔥 Thank you so much for sharing!
@iamrithmic
@iamrithmic 9 ай бұрын
Haha thank you! Glad you found it useful :)
@fricze
@fricze 8 ай бұрын
fajne
@babayaga5848
@babayaga5848 8 ай бұрын
i find this very complicated, dev is hard for me :(
@xbsidesx
@xbsidesx 9 ай бұрын
Why use that @apply instead of just using class name? If you want that as a component, just do a component, not a class with @apply. It’s counterintuitive and not recommended by tailwind.
@muslehuddin8847
@muslehuddin8847 9 ай бұрын
Reusable className
@xbsidesx
@xbsidesx 9 ай бұрын
@@muslehuddin8847 not the case here, it's used literally once. Also, if in the future you need it to be reusable, just do a component, it'll be exactly that ;)
@erentr7167
@erentr7167 8 ай бұрын
@@muslehuddin8847 which tailwind doesnt suggests and warns you to not to do that because whole point of tailwind is to get rid of class names.
@Sanatani_AyushEdit
@Sanatani_AyushEdit 8 ай бұрын
Ezsnippet army like 👍
@vulbyte
@vulbyte 8 ай бұрын
neat way to do so, but being real i feel like this is massively over coded. i would so something like (skipping most of the verbosity of code just to make it more concise): div: id=followMouse h=25%, w=25% clip:svgOutline then just have a js loop that lerps the xy of the mouse. this way you can also just apply it to every and any element on the page.
@morespinach9832
@morespinach9832 8 ай бұрын
Goodness. Tailwind is one of the worst things to happen to CSS. With the tag spaghetti. Any proper css way to achieve this?
@erentr7167
@erentr7167 8 ай бұрын
too many states, too many use effects bro. also you use a ref. you dont need to use that many hooks. you also pass them as props. dont do that. just use a single state with single event listener. you do too much calculation on that function.
@erentr7167
@erentr7167 8 ай бұрын
also you hold cursor x y state in root component which it will rerender each time you move the mouse, it will rerender the whole application, not ideal sorry.
@rollotomasi1832
@rollotomasi1832 8 ай бұрын
It's clear that you just finished your first React tutorial. Leave the heavy lifting to the big boys.😂
@erentr7167
@erentr7167 8 ай бұрын
@@rollotomasi1832 I think its just 4th year of me with typescript & react bro
@ImTheDot
@ImTheDot 7 ай бұрын
.
@Euquila
@Euquila 8 ай бұрын
10:40 let's take a moment to appreciate how useless typescript is in general
@Bodom1978
@Bodom1978 8 ай бұрын
Would have been better without React or Tailwind.
@schuste6
@schuste6 8 ай бұрын
why?
@vaccariaofsamsara
@vaccariaofsamsara 8 ай бұрын
why? care to explain?
@Bodom1978
@Bodom1978 8 ай бұрын
Because if this tutorial was done using native JS and CSS it would be useful to anyone regardless of the frameworks they do or do not use.
@schuste6
@schuste6 8 ай бұрын
@Bodom1978 is there something wrong with using them? im actually curious because i thought react, tailwind, etc are solid frameworks and they make it easier to create things. also they have more features
@Bodom1978
@Bodom1978 8 ай бұрын
There is nothing wrong with using them, I use them a lot, but I also have many projects that do not. A tutorial with native JS and CSS would be easily ported to any framework. But the other way around limits it to only React and Tailwind.
Create the PERFECT Button (TailwindCSS / Framer Motion)
9:21
This UI component library is mind-blowing
8:23
Beyond Fireship
Рет қаралды 730 М.
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Quilt Challenge, No Skills, Just Luck#Funnyfamily #Partygames #Funny
00:32
Family Games Media
Рет қаралды 55 МЛН
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
Advanced Sortable Drag and Drop with React & TailwindCSS
21:12
Tom Is Loading
Рет қаралды 54 М.
Build a Side Navigation with TailwindCSS and Framer Motion
16:27
You Need This Hover Effect On Your Site ASAP (CSS / JS)
5:10
Hyperplexed
Рет қаралды 464 М.
10 Tailwind Tricks You NEED To Know!
10:45
Ravi - Perfect Base
Рет қаралды 313 М.
Have You Ever Seen A Hover Effect This EXPLOSIVE 🤯
4:09
Hyperplexed
Рет қаралды 321 М.
A flexbox trick to improve text wrapping
5:02
Kevin Powell
Рет қаралды 226 М.
Framer Motion (React) - The Basics
17:07
rithmic
Рет қаралды 41 М.
Every React Concept Explained in 12 Minutes
11:53
Code Bootcamp
Рет қаралды 871 М.