Тёмный

How to make Eyeballs that Follow You Around 

Beyond Fireship
Подписаться 407 тыс.
Просмотров 343 тыс.
50% 1

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

 

24 сен 2024

Поделиться:

Ссылка:

Скачать:

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

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 794   
@artrix909
@artrix909 2 года назад
"You dont have to be good at math to be a programmer" - fireship 2021 "If you dont know trig, leave" - beyond fireship 2022
@zNermal
@zNermal 2 года назад
sad
@fanzypantz
@fanzypantz 2 года назад
if you program in html!
@imPrathamDev
@imPrathamDev 2 года назад
There should be two explanations multiple personality disorder or just hypocrisy 🤔
@maskettaman1488
@maskettaman1488 2 года назад
@@imPrathamDev or, you know, it's a joke
@atharvparlikar8765
@atharvparlikar8765 2 года назад
*in your head
@2231puppy
@2231puppy 2 года назад
I'd love to see more UI reverse engineering!
@BrunoGomes-su1bk
@BrunoGomes-su1bk 2 года назад
up
@vladostema
@vladostema 2 года назад
Yes
@sarcasticdna
@sarcasticdna 2 года назад
++
@kartikyadav571
@kartikyadav571 2 года назад
Bro give suggestion then
@erickazevedosousa9909
@erickazevedosousa9909 2 года назад
UP
@pewds337
@pewds337 2 года назад
For people who don't know math. To find the slope or inclination of a line from x-axis or horizontal axis you need to y2-y1/x2-x1 here (x1, y1) are the coordinates of first point in this case origin(0, 0) and (x2, y2) are coordinates of cursor. Slope of a line is also the tan of the angle between x-axis and the line. So after finding the slope you basically use a reverse trigonometric function or atan to find the angle. Like tan(45°) = 1 and atan(1) = 45°. You can also convert degrees into radian. 180° = πradian. So 1° = π/180 radian. For x degree radian value is xπ/180 I didn't knew my high school math would be this useful
@killerdroid99
@killerdroid99 2 года назад
this was simple, atan2(1st-argument, 2nd-arguement), where 1st arg is y2 - y1 and 2nd arg is x2 - x1, ( y = mx + c where m is the slope described as y2 - y1/x2 -x1 if (x1, y1) are origin then m = y2/x2)
@igbagboolaleye6047
@igbagboolaleye6047 2 года назад
Wow, great explanation
@deathofsuper8835
@deathofsuper8835 2 года назад
Oh man I was waiting for this. Now I can continue watching the video.
@abdultheseekerofknowledge4453
@abdultheseekerofknowledge4453 2 года назад
Great man, you should be working in Tesla 👏
@joshpetit
@joshpetit 2 года назад
If they pull one of these in a coding interview 😵‍
@ThatTrueCJ201
@ThatTrueCJ201 2 года назад
This effect looks even better when one offsets the eye-holes from the centre of the eye according to the distance from the eye to the cursor (linear and normalized scale). That way, if your cursor is directly on top of the eye, the eye will look straight ahead at the cursor.
@minnow1337
@minnow1337 2 года назад
canvas too hard 🥱
@adhochero6619
@adhochero6619 2 года назад
how did you do that?
@adissentingopinion848
@adissentingopinion848 2 года назад
@@adhochero6619 remove the pupils from the eyes. set the image to be only the pupil. set the base of the eye to be straight center of the eye ball. Calculate dX and dY like he did. Here's the tricky part: normalize the dX and dY by *1/sqrt(dX**2 +dY**2) and scale to radius of eyeball. Two ways to do this now: find the absmin(dX,normalized_scaled_dX) and for dY and apply, or use another bounding function that approaches a limit defined by your normalized value. Think a/(1-e**(-0.5dX)) - a/2, a good ol logistic curve. Just make sure the value is below f(x) = x at all times or else the pupil will look beyond the cursor.
@Henrix1998
@Henrix1998 2 года назад
@@adissentingopinion848 and now this is why webpages are so slow nowadays
@adissentingopinion848
@adissentingopinion848 2 года назад
@@Henrix1998 What do you mean? That's like 2 add/subs, 30 mults, and say 100 ops for the logistic curve. Are you suggesting, that your ALU can't run all of this on your Intel Celeron 1.2 GHz? No? Because if you don't decide to load 10.2 MB images every 10 seconds for ads, you computer is actually very fast!
@phatakom
@phatakom 2 года назад
So the maths I learned in college wasn't all of garbage use... Noice
@pixiedev
@pixiedev 2 года назад
not the math but college professors 🙃.
@KevinArellano
@KevinArellano 2 года назад
Yay for math
@Skyflairl2p
@Skyflairl2p 2 года назад
My brain used to shut down the second anyone even mentions algebra (or any math jargon beyond the basics). But hey, In changing my perspective of maths and thinking of it as a coding language it just suddenly makes a lot more sense!
@alireda640
@alireda640 2 года назад
Trig is high school level
@solastrr1795
@solastrr1795 Год назад
Wdym college? Trigonometry is highschool level. Algebra and Calculus are college level stuff. I think your situation is beyond them being garbage, they don't even exist on you LMAO
@martinc.7424
@martinc.7424 2 года назад
Not a front Dev here, pretty happy to have glimpse of how you guys work! Thanks a lot !
@gg-gn3re
@gg-gn3re 2 года назад
not really how they work. There's a reason so many are freaking out adobe is buying figma... front enders are generally complete morons and use those drag and drop tools and that's about the end of their capability. 10% of them know code, and maybe 1% of those 10% are able to do basic reverse engineering or do this kind of math.. Lots of "busy work" to be done by others
@OFfic3R1K
@OFfic3R1K 2 года назад
Do you mean the part where we steal someone's idea, code and rehash it into an even worse monstrosity? Yeah, that's front-end for ya. The only part that was left out is when you npm 25GBs worth of frameworks and dependencies to host this bad boy of a web page.
@Niksorus
@Niksorus 2 года назад
That's crazy stuff too, I could never do that 🤣
@Secreto31126
@Secreto31126 2 года назад
It would have been funny if you calculated the angles per eye, not from the rectangle, so they could watch your mouse even if it's in their nose
@Cypekeh
@Cypekeh 2 года назад
Thought so too but I think it could look a bit unnatural, and it would also be more expensive to calculate
@thekwoka4707
@thekwoka4707 2 года назад
@@Cypekeh well, if he does the calculation only once per frame, that could be improved.
@Secreto31126
@Secreto31126 2 года назад
@@Cypekeh obviously it will be more expensive, but really that much expensive? Even the simplest notebooks have at least 4/6GB of ram and Celeron CPUs are long gone. I bet it's not that hard to compute 4 atan() every few milliseconds.
@xtunasil0
@xtunasil0 Год назад
Also, I think the current implementation will bug if you pass the the mouse between Rick and Morty because of the fact it's not calculated for each eye
@FieldSpot
@FieldSpot 2 года назад
After the previous video, we were all waiting for this.
@wlockuz4467
@wlockuz4467 2 года назад
I think another fun effect would be to make the eyes bigger as you move the mouse closer to the characters.
@klutch4198
@klutch4198 2 года назад
Make it happen and post it in the showcase channel in the new fireship discord!
@BiteYt69
@BiteYt69 2 года назад
3:47, "thats where stackoverfl- I mean trigonometry comes in" Beyond Fireship 2022
@giancarl021
@giancarl021 2 года назад
I think you could’ve used the “rad” CSS angle unit to avoid conversion. Btw awesome video
@modolief
@modolief 2 года назад
Good catch!!
@StephenGillie
@StephenGillie 2 года назад
That's rad.
@_the_one_1
@_the_one_1 2 года назад
Reverse engineering is a rare skill! More videos about it please!
@scriptkid4561
@scriptkid4561 Год назад
????
@bassjio
@bassjio 2 года назад
You also don't have to manually convert from radians to degrees, CSS transforms accept "rad" as a unit type.
@Semtx552
@Semtx552 2 года назад
I wanna see other UI elements reversed engineered like this
@beinyourguard
@beinyourguard 2 года назад
3:46 "That's where stack overfl---I mean, trigonometry comes in" LOL
@Dude29
@Dude29 2 года назад
It's fun to see unorthodox things like this that only show up once in a while and especially fun to see how they are implemented!
@DampeS8N
@DampeS8N 2 года назад
If you did it per eye box you wouldn't have to awkwardly stay around the edges of the image and you could make them go cross-eyed. Easy change.
@wlockuz4467
@wlockuz4467 2 года назад
3:47 I laughed so hard I lost my breath 😂
@gergoradeczki
@gergoradeczki 2 года назад
- optimizes code - keeps console.log() in the event listener
@DesiMatrixXD
@DesiMatrixXD 2 года назад
😂
@davidarnold1881
@davidarnold1881 Год назад
Seriously improving the quality of front end Devs. I won't lie I really appreciated you hoisting the vars, micro-optimisations add up =D
@patric_forreal
@patric_forreal 2 года назад
Daim This is cool, Like how one uses mathematics to solve problems... Pretty cool
@CaliburPANDAs
@CaliburPANDAs 2 года назад
100K subs barely a month in. Good for you, Jeff!
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Questions can come in⬆️ Helpline📲
@kaydennguyen2168
@kaydennguyen2168 Год назад
I really do appreciate all the humor you put into your videos! Makes it so much more engaging :D
@jobsunday833
@jobsunday833 Год назад
Thanks bro finally someone who isn't posting malware or fake stuff, you deserve my subscribe!
@MoodyDood
@MoodyDood 2 года назад
"this is where stack overflow- I mean trigonometry comes in" no sir you were right on the first one
@MerkieAE
@MerkieAE 2 года назад
This is one of the best videos on front-end engineering I've seen holy shit there's so many great pieces of information in here. thank you Mr. fireship
@creatorsremose
@creatorsremose 2 года назад
Being old makes in inevitable to witness history repeat itself. That was a very common effect in webpages 15 years ago.
@Sasha32659
@Sasha32659 2 года назад
Still timeless😁
@hojdog
@hojdog 2 года назад
I love that tip of using devtools to place absolute elements. That is a pro tip, I never thought of that!
@jakewolf079
@jakewolf079 Год назад
Thanks man this works flawlessly, I now have a cute moon png that follows my cursor around!
@anasrin
@anasrin 2 года назад
css support many rotation angle units, not only degree but also radian so you can just use the atan2 result
@DonaldRecord
@DonaldRecord 2 года назад
That Stack Overflow joke was -so true- comedy gold
@taufiqsept
@taufiqsept 2 года назад
If you're a game developer, linear algebra and geometry is a must
@AndrewErwin73
@AndrewErwin73 Год назад
"If you can't do trigonometry in your head, you really have no business programming in HTML!" Classic
@dhmgroup
@dhmgroup 2 года назад
Awesome tutorial Jeff
@corbulo87
@corbulo87 2 года назад
The sheer number of times you fit eyeholes into this video filled my heart with joy.
@ChrisHaupt
@ChrisHaupt 2 года назад
That hue rotation 🤌
@jaymehta7681
@jaymehta7681 2 года назад
More reverse engineering videos please 🔥
@andrebotha5270
@andrebotha5270 2 года назад
Jeff. You have this RU-vid tutorial thing nailed. Brilliant script and editing. Funny and informative. Top notch 👏
@selvamuthukumarmarimuthu258
@selvamuthukumarmarimuthu258 2 года назад
This is cool, Jeff!! I would love to see popular sites from awwwards with unique designs or something similar, reverse engineered like this. It would make for a good series. Keep them coming !
@quincy6199
@quincy6199 Год назад
I just made this using Monkey D. Luffy's eyes and I feel fulfilled. Thanks Jeff
@sharmarahul384
@sharmarahul384 2 года назад
I love trigonometry. I mostly use it in my HTML5 Canvas with Javascript!
@eboatwright_
@eboatwright_ 2 года назад
"Now that we have the _real_ programmers here..." Sir I clicked on a _JavaScript_ video
@gwerneckpaiva
@gwerneckpaiva 2 года назад
'Stack over- trigonometry comes in hand' Legend.
@jakethis3355
@jakethis3355 2 года назад
God damn, your humor is so on point.
@Mawsdtheking
@Mawsdtheking 2 года назад
Thank you for these videos! I’m just starting my web dev journey but I plan on going back and rewatching your videos for great ideas and tips when the time comes!
@brndto
@brndto 2 года назад
I literally missed out on trigonometry at school because I was in hospital for a few months and the school didn't even make an attempt to catch me up on any of the work I had missed. Safe to say I successfully failed the trigonometry test when I first got back to school.
@fvbixn
@fvbixn 2 года назад
Really like those videos, and with your type of humor I could watch these forever. Would love to see more reverse engineering stuff!
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Our helpline⬆️ Contact me ⬆️
@notemployedatfaang8483
@notemployedatfaang8483 2 года назад
I would absolutely love to see more reverse engineering! It's really helpful to see the thought process around creating these kinds of elements.
@jijgalib3247
@jijgalib3247 2 года назад
reverse engineering a code is a banner for a developer but its so cool and educating to know. we are looking forward to more of it!
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Questions can come in⬆️ Helpline📲
@Exilum
@Exilum 2 года назад
"That's when stack overflo-" Most relatable moment of the entire video. Have to say, whenever we know exactly what we want, how we want it and just need a bit of math, we all know where to go.
@andrewwashburn9357
@andrewwashburn9357 Год назад
Good style and a fun effect to implement. Thanks for the inspiration Fireship!
@SupreethBS
@SupreethBS 2 года назад
Please for the love of everything that's holy *Reverse engineer the whole UI of the stripe homepage*
@alexbinenstock5480
@alexbinenstock5480 2 года назад
This is such a fantastic idea for a series, keep it goin.
@devincheca9605
@devincheca9605 2 года назад
This was such a good video. Both super clever and hilarious. Came for the js, stayed for the Morty.
@wchorski
@wchorski Год назад
a video diving into 'Browser Dev Tools 101' would be most excellent
@abdiwadudhaji5800
@abdiwadudhaji5800 9 месяцев назад
i LOVE how you make leaning web development exciting 🥳 I'd also like to see more UI reverse engineering
@QCAlpha-212
@QCAlpha-212 2 года назад
Since you asked, Apples Marketing pages are just beautiful. There's so many interesting moving parts that you could probably find something to showcase and reverse engineer
@Torbikini
@Torbikini 2 года назад
I know it’s probably a bit harder to do now, but discord used to have a really cool login animation. I wonder how it worked. Basically there was an animated gray blob in the upper left and when you logged in the background would become engulfed in the gray. If you search on RU-vid there’s a video of it.
@radofa610
@radofa610 2 года назад
just finished making my first track! thanks bro for all the help with learning soft soft. much love
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Questions can come in⬆️📲😊
@nomadshiba
@nomadshiba 2 года назад
tho you dont even need atan2, you can just normalize the direction and use `transform: translate()` easier to understand and ever more customizable later
@alireda640
@alireda640 2 года назад
who? I didn't understand?
@avishkarhande
@avishkarhande Год назад
That's where the StackOver.... I mean Trigonometry comes in 😂😂😂🙌
@mtnwildernessfamily
@mtnwildernessfamily 2 года назад
As soon as I saw your video on PocketBook DB I knew your next video was going to be an eyeball CSS video :)- Love your channel!
@karimnassar7706
@karimnassar7706 Год назад
This guy, love these videos
@ConspicuousPumpkin
@ConspicuousPumpkin Год назад
Using JavaScript and Math to help RICKROLL his eyes. Nice.
@great_tech
@great_tech Год назад
I am giving you a thumbs up just for the scene
@portal2walkthroughpc
@portal2walkthroughpc Год назад
def will love to see more of this. Please make a playlist of these. Thanks
@Jayxus
@Jayxus 2 года назад
Oh damn this was so instructive to watch as a self searching skill to have ! Keep up the good work man :)
@MrBrax
@MrBrax 2 года назад
Nostalgia back to my ActionScript 2 days, used this technique so much :)
@ahmadsofwan4069
@ahmadsofwan4069 2 года назад
Do more content like this!!!
@dhansb883
@dhansb883 2 года назад
YES YES WE NEED MORE OF THIS
@etcode
@etcode Год назад
This is pure gold 👀👁
@Kaitokid730
@Kaitokid730 2 года назад
And that is why stack overflow is each programmer best friend
@GGdevelopment
@GGdevelopment 2 года назад
I LOVE THE RICK AND MORTY REFERENCES 🙂
@logiclb
@logiclb 2 года назад
Love this kind of video. Only complaint is the rick and morty eye pupal should be the very iconic looking asterisk.
@ZyncInteractive
@ZyncInteractive 2 года назад
All I got from this was: "If you don't know Trigonometry, get Rekt"
@birdpump
@birdpump 2 года назад
that effect definitely sold you
@Arcaz96
@Arcaz96 Год назад
I would like to see more reverse engineering videos like this. You videos both in Fireship and Beyond Fireship always motivates me to be a better developer.
@olufemiolufade3325
@olufemiolufade3325 Год назад
So thankful for this
@mythacker4365
@mythacker4365 2 года назад
3:47 Thats where Stackoverflow comes...*errs* Trigonometry comes in. Lol that was a clean 🤣
@hydra4370
@hydra4370 2 года назад
Ahh, my gamedev days if trying to make a projectile shoot towards the cursor :)
@thebarnold7234
@thebarnold7234 2 года назад
the stack overflow joke caught me off guard im not gonna lie
@FrazerKirkman
@FrazerKirkman 2 года назад
Thanks for showing us Style.filter = 'hue-rotate(..' Pretty cool
@lucaletsplayt
@lucaletsplayt 2 года назад
I wanted to see the easiest ways of making a cool button animation for submitting forms. all of my ideas where inconvenient. Love your content btw. Also thanks for introducing me to js webframeworks :p
@ahmedthebest
@ahmedthebest 2 года назад
I really love this kind of videos.
@mo_fakhri
@mo_fakhri 2 года назад
That's the content that I enjoy using RU-vid with
@anasammor3408
@anasammor3408 2 года назад
i love when he tests it out for us
@pilotkid2011
@pilotkid2011 2 года назад
My alarm every morning is that eye holes snippet from Rick and Morty
@bunsbof
@bunsbof Год назад
dude, I dont even undertand how u did that, but that so coollll, love u❤
@axeleli6845
@axeleli6845 2 года назад
Reverse engineering big software like Netflix , tools they use and how they’re used is always super educational 😁😁😁😁
@axeleli6845
@axeleli6845 2 года назад
I would love to see a video on Netflix’s anti screenshot tech. People don’t really know about it (EME files etc)
@zamba2238
@zamba2238 2 года назад
This worked incredibly well! I can finally play it thanks
@amirt825
@amirt825 4 месяца назад
This is how I did it a few weeks ago on a project, funny this comes on my feed now. Mine doesn't just rotate the pupils, it moves them relative to the distance of the cursor so the pupil is in the center when you hover on the eye and the movement is much more natural. A little more trig, but that's what chatGPT is for: const face = document.querySelector('#face'); const pupils = document.querySelectorAll('.pupil'); const rect = face.getBoundingClientRect(); document.addEventListener('mousemove', function(e) { pupils.forEach(pupil => { const pupilRect = pupil.getBoundingClientRect(); const centerX = pupilRect.left + pupilRect.width / 2 - rect.left; const centerY = pupilRect.top + pupilRect.height / 2 - rect.top; const x = e.clientX - rect.left - centerX; const y = e.clientY - rect.top - centerY; const angle = Math.atan2(y, x); const maxDistance = rect.width * 0.018; const actualDistance = Math.sqrt(x * x + y * y); const distance = Math.min(maxDistance, maxDistance * (actualDistance / rect.width)); const pupilX = distance * Math.cos(angle); const pupilY = distance * Math.sin(angle); pupil.style.transform = `translate(${pupilX}px, ${pupilY}px)`; }); });
@xan3xx443
@xan3xx443 2 года назад
Reverse engineer three js. The would be complex but I think would be a very interesting topic under the the hood. Plus your style of commentary goes really well with large amount of information.
@notreallyhaarsh
@notreallyhaarsh Год назад
"Now we will use stackove- i mean trigonometry to calculate the angle" had me 😂
@samsonorode6568
@samsonorode6568 2 года назад
Fireship!!! i'm not ashamed to say i've sold most of my research time to your channels. Thanks for always cooking awesomeness ♥
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Questions can come in⬆️..
@egecangurdek4982
@egecangurdek4982 2 года назад
Nice video man, clear and concise explanation! Thanks a lot!
@saalimmohammed1599
@saalimmohammed1599 2 года назад
I'm a simple man. I hear trigonometry. I stop watching the video
@yousafsabir7
@yousafsabir7 2 года назад
Jeff asking on Twitter what topic to make a video on and then makes one out of his own liking. Still very nice stuff... Thanks
@Bhanukamax
@Bhanukamax 2 года назад
oh man this is a good one!, I couldln't stop laughing for few moments since the "stackoverflow" thing, and turns out I'm not a real programmer lol best programming youtube channel, I love the blend of really good content + humor, keep it up!
@user-gm3eo1dp1y
@user-gm3eo1dp1y 2 года назад
Our helpline⬆️ Contact me ⬆️
@charbelboughazale3994
@charbelboughazale3994 2 года назад
"That were stackOver-- I mean trigonometry come in", this line got me falling off the chair🤣🤣🤣🤣🤣🤣
@edathegreat
@edathegreat 2 года назад
Your video on pocket base changed my life
Далее
100+ JavaScript Concepts you Need to Know
12:24
Просмотров 2 млн
ImNotGoodEnough.js
11:11
Просмотров 895 тыс.
The LIES That Make Your Tech ACTUALLY Work
11:29
Просмотров 823 тыс.
Dear Game Developers, Stop Messing This Up!
22:19
Просмотров 714 тыс.
Industrial-scale Web Scraping with AI & Proxy Networks
6:17
PROOF JavaScript is a Multi-Threaded language
8:21
Просмотров 280 тыс.
how to never write bug
7:20
Просмотров 883 тыс.
C++ Developer Learns Python
9:26
Просмотров 2,7 млн
How to -10x Engineer Correctly
22:22
Просмотров 507 тыс.
The perfect imperfection of Google's Material You
15:47