Can I Create Netflix’s Video Carousel UI?

Поделиться
HTML-код
  • Опубликовано: 7 июн 2024
  • Netflix has some incredible UI, but at the core of all its UI features is the video carousel. This is a simple looking piece of UI, but it is incredibly complex. In this video I attempt to recreate this UI component live for the first time.
    📚 Materials/References:
    GitHub Code: github.com/WebDevSimplified/n...
    🌎 Find Me Here:
    My Blog: blog.webdevsimplified.com
    My Courses: courses.webdevsimplified.com
    Patreon: / webdevsimplified
    Twitter: / devsimplified
    Discord: / discord
    GitHub: github.com/WebDevSimplified
    CodePen: codepen.io/WebDevSimplified
    ⏱️ Timestamps:
    00:00 - Introduction
    00:55 - Planning
    02:10 - Slider HTML
    03:53 - Slider CSS
    10:06 - Slider Left/Right Buttons
    33:53 - Slider Progress Indicator
    52:31 - Slider Wrapping
    #NetflixCSS #WDS #LiveCoding

Комментарии • 111

  • @Mike-tb2hw
    @Mike-tb2hw 2 года назад +8

    These videos are 🔥!!! Keep it up Kyle! Love all the new tricks and troubleshooting tips watching your live videos. Especially debugging CSS

  • @Andressuquaz156
    @Andressuquaz156 2 года назад +9

    32:32 that has to be the biggest flex i've ever seen in a tutorial

    • @WebDevSimplified
      @WebDevSimplified  2 года назад +5

      Lol. You would be surprised how many times I reference my own blog to remember how to do things.

    • @AF911vids
      @AF911vids 2 года назад +2

      @@WebDevSimplified bro..the amount of knowledge you have is just amazing..i wish one day i could solve problems like you..

  • @Me-sz7yy
    @Me-sz7yy 2 года назад +7

    I really love your videos, I strongly believe that this way of teaching make it easier for us to learn how to solve problems from beginning to end, the amount of information that they have is so valuable... thanks a lot 😀😀

  • @mannixmd
    @mannixmd 2 года назад +11

    You can use ::before and ::after on buttons you just forgot "" in the content property :)

  • @MChiemelie
    @MChiemelie Год назад

    Great work, man. Great work. I love your tutorials. I've watch many ready.

  • @jasoncavanaugh1556
    @jasoncavanaugh1556 2 года назад +1

    More videos like this! That was great to watch!

  • @sh0ck238
    @sh0ck238 2 года назад

    Thanks dude! Was looking for a guide on this everywhere, super cool!

  • @sterix
    @sterix 2 года назад +2

    I'm going to have to try to implement this for my own site. Great video!

  • @shermanwong9866
    @shermanwong9866 2 года назад

    I have been looking for this for such a long time!

  • @perstry2397
    @perstry2397 2 года назад +2

    learning many tricks in 1 video , thank you sir for this content

  • @bradleybinho
    @bradleybinho 2 года назад +43

    its like you read my mind mate! been fascinated by carousels like the ones on disney plus and netflix and I finally get to see the best web dev channel have to go! love it

  • @VideoWow7184
    @VideoWow7184 2 года назад

    I've been watching a few of your videos and what I like the most is how you explain things, very clear and easy to understand.
    About the Netflicks slider, I believe it has a popout when you click on a video that overflows over content below the slider, I could be wrong but I recall seeing that somewhere. If it does have one then I'd be interested to know how that could be done.
    I've tried to do it in sliders I've built using flexbox where the overflow-x is set to auto so that the slider will scroll horizontally and the overflow-y set to visible so that popout will overflow vertically but the overflow-y automatically gets set to auto if overflow-x is also auto.
    The only way I was able to do it was to make the slider wider or by making the popout absolute and positioning it with some JS. Although these solutions work, they come with their own problems. For example, making the slider wider means that it takes up more space, whereas making the popout absolute prevents the slider underneath from scrolling because the events get captured by the popout.

  • @krishnachaitanya4067
    @krishnachaitanya4067 2 года назад +12

    32:35 referring own blog and finding out the solution tells us to we need to maintain our notes, I do it and push it to git :)

    • @wittyhumour29
      @wittyhumour29 2 года назад +1

      I Agree. Started maintaining notes too.

  • @0VexRoblox
    @0VexRoblox 2 года назад +15

    For the infinite scroll is it practical to just clone the first four items in the container and append to the end, and when it's trying to move again remove the transition and set the current position variable to 0 and then add the transition back and then again set the current position variable to 1? Same logic for the left.
    Maybe cloning the children and appending them accordingly beforehand and just changing the left button and right button logic to what I mentioned would work?

  • @fcurcic
    @fcurcic 2 года назад +54

    You should re-do this for react, would be interesting to see how you'd structure the components

    • @Rageypeep
      @Rageypeep 17 дней назад

      its really easy todo in React, im doing it at the moment, to chage the "--slider-index" you just "useState()" to chage it onClick of the handles, also using a "const numberOfImages = 9;" you can stop the over scroll just by using a bit of math, something like "setSliderIndex(prevIndex => Math.min(prevIndex + 1, numberOfImages - 4));" on the right click, that will always keep 4 images visable, its really simple to do. The whole page with HTML is about 45 lines of code. I'm also looking at using HTMX on the images as this will make them much more dynamic, also it will only load the images when called, so it makes the proformance really fast.

  • @nicholasdittmer4494
    @nicholasdittmer4494 Год назад

    These tutorials are amazing! Thank you very much

  • @AM-rl8lv
    @AM-rl8lv Год назад +4

    I hope one day Kyle comes back on the wrapping feature as implemented by Netflix. It is a sort of infinite scroll, hope you can make an awesome video about that ; ) Thanks for all your great content!

  • @rayyan-munassar
    @rayyan-munassar Год назад +1

    Bro outsmart netflex with the button move. Well done that all I can say.

  • @rockNbrain
    @rockNbrain 2 года назад

    Great content Kyle 👌

  • @chuckcoughlin3112
    @chuckcoughlin3112 Год назад

    I love this format. It muchmore educational to watch ur thinking. Be a project and working thru it creates a longer video, but muc h better to comprehend.😄

  • @sagun6268
    @sagun6268 2 года назад

    keep making thses videos loved it 🔥

  • @YuriiKratser
    @YuriiKratser 2 года назад

    Thanks for this great video!

  • @kinstar
    @kinstar 2 года назад +1

    I was thinking about this last night and now your video pops up, you're spying on me 😱

  • @PachucoDesigns
    @PachucoDesigns 2 года назад +8

    You are an extraordinary talent, man. I would kill to have this level of knowledge and competence.

    • @herpaderppa3297
      @herpaderppa3297 2 года назад

      Pretty simple, sit down your ass and learn

  • @alexanderboos8318
    @alexanderboos8318 Год назад

    Great work!

  • @varangianventure
    @varangianventure 2 года назад

    Had a project where this tutorial was just perfect. Definately learned a few new tricks. .-)

  • @tesfatesfaye6262
    @tesfatesfaye6262 2 года назад

    Bro I was literally thinking about this two days ago, shot how u read my mind!

  • @shehzadkhan1170
    @shehzadkhan1170 2 года назад +1

    Do we need to specifically set box sizing to the *::before and after element?? Cause when I set the box sizing for *, in the inspect mode in chrome, it showed that the before and after of * are set to the same.

  • @medouadjihboudraa7706
    @medouadjihboudraa7706 2 года назад

    Nice video, for the html arrow on the left/right handle to be centered instead of using flex and text align and justify-content you can use padding-top : 5% padding-bottom : 5%

  • @ritvarsfreimanis
    @ritvarsfreimanis 2 года назад

    Ok, I'm definitely interested

  • @raphaelmachado7197
    @raphaelmachado7197 Год назад

    You are the best web dev youtuber

  • @MuhammadAhmedAshraf
    @MuhammadAhmedAshraf 2 года назад +6

    can you create paper ripple animation like youtube have when there's no internet there's a retry button and it flows from where the button got clicked and when you long press on it it goes slowly and when you double tap continously it doesn't have a delay it goes smooth like youtube have

  • @pezcue937
    @pezcue937 2 года назад

    thank u. This is great

  • @javascript_developer
    @javascript_developer 2 года назад +1

    Its a nice approach to make slider. Again I was expecting to be able to scroll horizontal via magic mouse scrolling left and right. Normally with scrollbar its possible and also mobile friendly but hiding the scroll bar and making it horizontal scroll is chalangable.
    RUclips horizontal menu looks perfect to me which support vertical scroll and horizontal scroll from magic mouse touch pad in both cases it container scroll horizontally. Another example would be facebook shorts slider. Its great.

  • @johnadriandodge
    @johnadriandodge 2 года назад

    Excellent Jedi K!
    🧠

  • @TwoTeaTee
    @TwoTeaTee 2 года назад +1

    The left/right arrow should have had flex direction as column to get it dead centre?

  • @anthonyzornig
    @anthonyzornig Год назад

    Top! Works seemlesly.

  • @cryzz0n
    @cryzz0n 2 года назад

    Hmm I think the main problem of the pseudoelements for the arrows was that the character wasn't wrapped around quotes. And of course, great video as always!

  • @Rishikcharan
    @Rishikcharan 2 года назад +1

    Amazing 👏

  • @MaxWeir
    @MaxWeir Год назад

    Is it possible to use scroll snap for small screens then the left/right arrows for large?

  • @surajitdas6555
    @surajitdas6555 Год назад

    I wish I would have seen your this video before. Last month I implemented the same in an angular application it took around half a day for me

  • @fvdham
    @fvdham 2 года назад

    If you do flex with a width and no grow you might as well do inline-block?

  • @pseudocoffee4829
    @pseudocoffee4829 2 года назад

    I remember doing this in the first few weeks of webdev in university.

  • @MisterGeekey
    @MisterGeekey 2 года назад +1

    Maybe you could've tried playing with the slider's children's orders to emulate the wrapping. Let me explain:
    1st - There are two cases for this wrapping effect, one if the (# of items)/(# of items per screen) [let's call that groups] is < 5 and one if it is >= 5
    In other words an active group (the 4 displayed thumbnails in your example) should be surrounded by at least 2 groups on each side. So for #groups < 5 you'll have to create copies.
    2nd - Regardless of the copies created or not, each thumbnail should have an order, from 1 to 12 in your example. When the slider is shifted right, all the orders should be incremented by 1 except the last one that should get the value 1, or be moded mod12 (this way all the orders still range from 1 to 12).
    If the slider is shifted left then they should all be decremented by 1 and the first one gets the value 12, or gets moded mod12. This should accomplish the wrapping effect to some extent.

  • @benettsif4147
    @benettsif4147 2 года назад

    WOW, just WOW. you did the looping of the carousel like it was nothing while i'm still scratching my head around it while i'm typing this comment.
    If i may ask a small request?Can you add an event that when the user presses one of the pics, that pic whould show on the center of the screen on a different div??

    • @georgebradley4583
      @georgebradley4583 2 года назад

      You'll need a click event listener that will set the image to position absolute and the different div will need to be set to relative.

  • @imane5971
    @imane5971 Год назад

    what do you do about the gap when you have an uneven number number of slides though?

  • @hassaneoutouaya
    @hassaneoutouaya Год назад

    Thank you so much!
    I was just thinking about what if we hit the last item on the slider and we want to back to the first slider item:
    my idea is we have to:
    - Convert the slider items to an Array(slidesArray)
    - Shift (or splice from the index 0) the amount of slides depending on the given (--items-per-screen) from the slidesArray
    - Push the shiftedSlidesItems to the slidesArray.
    and vice versa when it comes to the left handle click, pop the last items(poppedItems) from slidesArray, then unshift the poppedItems to begin of the slidesArray again.

    • @A.Dalton
      @A.Dalton Год назад

      easier solution for me i already did , make the sliderindex=0 when i equal a specific number you decide

  • @me_manish_prajapati
    @me_manish_prajapati 2 года назад

    Kyle, I want to watch this type of vdo. But these are too lengthy for me. Can have some different way? Or only solution is to Speed up playback?
    Thanks for amazing vdos.

  • @catafest-work
    @catafest-work 2 года назад

    what snippets use you in this video tutorial for these 9 images tags? thank you for sharing.

    • @catafest-work
      @catafest-work 2 года назад

      @@waternlava yes I found it. thank you for share !

  • @abashasani7265
    @abashasani7265 2 года назад

    I had this issue a while back it would have been a blessing if you had done this soone 😂😂

  • @techiebytes1
    @techiebytes1 Год назад

    Hi Bro thanks for the video, pretty awesome. But I got a problem maybe you can help me. When I try to implement a url in the images I lost the size configuration.

  • @airjason13
    @airjason13 2 года назад

    This is aesome!

  • @imluctor5997
    @imluctor5997 2 года назад

    first thing i see is you making sure every image is scaled right but i think the movies are required to send them in the right resolution size or the img itself is being scaled and not inside the code

  • @its_code
    @its_code 2 года назад

    I love 💕 this video 😍

  • @javascript_developer
    @javascript_developer 2 года назад

    It doesn't seems to be working with iphone safari. I am guessing the issue is with that width not able to calculate.

  • @craig1253
    @craig1253 10 месяцев назад

    Big fan here! Hoping you redo this using react js

  • @seeker3794
    @seeker3794 Год назад

    As a newbie although having some understanding of js, I was completely confused with javascript code you provided.😅

  • @jonathanjensen9147
    @jonathanjensen9147 8 месяцев назад

    You should give the DoorDash Slider component a shot - Its a responsive version of this that coordinates horizontal scroll with incremental clicks

  • @richardc4215
    @richardc4215 2 года назад

    can you explain the flex that you used for .slider > img? I dont understand how that works.

  • @Tony.Nguyen137
    @Tony.Nguyen137 2 года назад

    Can you try to recreate airbnb‘s scroll animation

  • @VisualArtRonny
    @VisualArtRonny 5 месяцев назад

    I made something similar using scroll and moving nodes around, instead of translate.
    Works beautifully in desktop and android, but iOS devices touch events won't allow me to adjust the scrolling while touch is being processed...
    like if (slide.scrollLeft == 0) {
    slide.insertBefore(lastItem, firstItem);
    // The following is being ignored by iOs devices
    slide.scrollLeft = firstitem.width;
    }
    Any thoughts on the matter would be greatly appreciated.

  • @Michael-yp8zl
    @Michael-yp8zl Год назад

    being trying to recreate this with react
    and i am stuck on the logic for the active slider

  • @yofi2614
    @yofi2614 Месяц назад

    I don't get why do I need to give the slider >img max-width if I have already gave flex 0 0 25% and only by that I'm "telling" the each image to be max 25% of the .slider container

  • @privateinvestigationenterp4403

    Has anyone found out how to insert actual videos and it still work? I've tried, and it works until the slider buttons disappear after it populates over what it initially holds without sliding it.

  • @gopalloharnew5948
    @gopalloharnew5948 2 года назад +4

    17:00 because you forgot to put the code in string !

  • @chrisarmstrong2721
    @chrisarmstrong2721 2 года назад

    is there a wordpress plugin that can do this?

  • @Skiid388
    @Skiid388 9 месяцев назад +1

    What if there are 7 cards in the slider? There is 12 so it s good scenario but so you can click 4 times but what if there is 7 image cards?

  • @liftingforfun2347
    @liftingforfun2347 2 года назад

    this guy is insane..

  • @catalinim4227
    @catalinim4227 2 года назад

    sliders are easy, just offset the container by width of cards

  • @2herzog
    @2herzog 9 месяцев назад

    i cant get the items to have the same height and the gap between them varies

  • @thesloth6733
    @thesloth6733 2 года назад +1

    Please make it in Reactjs also.

  • @raipeter
    @raipeter 2 года назад +3

    Is it just me who didn't know about the aspect-ratio property ? Damn

  • @arcanistzed
    @arcanistzed 2 года назад +1

    Which keyboard shortcut do you use to move the current line up or down?

    • @Asty__
      @Asty__ 2 года назад +2

      Ctrl + Alt + Up or Down Arrow, as far as I know

  • @curt8806
    @curt8806 2 года назад

    It's not fair. You're beautiful and smart. None of us have a chance

  • @user-my5lr8pz5j
    @user-my5lr8pz5j 2 месяца назад

    There seems to be a problem when nesting flex boxes and defining flex-basis on child items. Browsers don't seem to allocate enough space in the parent flex container. At 42mins into the video Kyle is struggling with the progress bar items not fitting in the parent container and that's because there's an overflow. If he clicked on the flex button in dev tools then the overflow would have been obvious. In that case min-width is a workaround to make the child items fit inside the parent flex container. Also at 44mins Kyle changes the width of the progress bar items and he plays around with flex-basis which has no effect only min-width works. I'm wondering why nobody picked up on this issue and how many actually followed Kyle from the beginning to the end like I'm doing. Kyle has a tendency to talk fast and in some parts of the video he was modifying quite a few CSS rules without refreshing the browser. I've been following Kyle's tutorials for some time and have learnt a lot, however I do prefer watching Kevin Powell's videos because he takes his time and explains things thoroughly. He recently finished a video similar to this one but using HTML and CSS only. I hope Kyle takes my feedback as constructive.

  • @that1coolkid
    @that1coolkid 2 года назад

    dude you should have used bootstraps carousel function

  • @BMikel
    @BMikel 7 месяцев назад

    why not use swiper lib instead?

  • @jjfattz
    @jjfattz 2 года назад +1

    You just had to put the chevron code in quotes! "\203a"

  • @anhmap9055
    @anhmap9055 2 месяца назад

    No one is always smart, no one knows everything, there are times when they know what is wrong but try to ignore it to avoid finding a solution for it.

  • @idk6465
    @idk6465 Год назад

    What if you wanted to move in one at a time, infinitely?

  • @aldeen9190
    @aldeen9190 2 года назад

    this is programmer's version of netflix and chill

  • @joaothomazini
    @joaothomazini Год назад

    Every time I see people messing with CSS I praise the gods for tailwindcss

  • @GabrielMartinez-ez9ue
    @GabrielMartinez-ez9ue 2 года назад

    Currently building a react component using this + tailwindcss. Anybody successfully made it?

  • @7heMech
    @7heMech 2 года назад

    Yes.

  • @mikaleo8776
    @mikaleo8776 2 года назад

    Bootstrap?

  • @MilanDrazic
    @MilanDrazic 2 года назад

    i created a similar but even worse design.
    I have The same sliders are one for the category that moves by one field, the other by seven fields and the third by three.
    And I did it to handle all one function recursively
    and function for bullets
    the other problem is bigger, because there is a diver for everyone on the left side, which must not be seen at the beginning and end of the container.
    so it’s especially that it’s all responsive, horror

  • @mirandatp3249
    @mirandatp3249 2 года назад

    😊😊😊

  • @mrtinsen
    @mrtinsen 2 года назад +1

    Coincidence? Kevin Powell 6 hours ago: ruclips.net/video/vpx8pQaaJ38/видео.html

  • @BMikel
    @BMikel 2 дня назад

    Please recreate this in React

  • @skb875
    @skb875 2 года назад

    Love your videos and seeing how you solve problems. However, you say "essentially" so often, it's a little distracting haha.

  • @hugooliveirapinho9218
    @hugooliveirapinho9218 Год назад

    INFINITE SCROLL? 5/10 rsrsrs, how to do it god!!!

  • @jowarnis
    @jowarnis 2 года назад

    getting rid off HTML and instead using only js to write it could easily solve infinite carousel problem.

  • @reydez84
    @reydez84 2 года назад

    you're insane lolol

  • @suelingsusu1339
    @suelingsusu1339 2 года назад

    👏👏👏👏🙏🙏🙏🙏👌👌👌👌🖖🖖🖖🖖🖖🖖

  • @Wade-vo6zx
    @Wade-vo6zx 2 года назад

    I think you can not only create Netflix's video carousel but that you can do even much much better. Need to start believing in yourself and your own creativity already

  • @darvil82
    @darvil82 2 года назад +4

    Hmm I think the main problem of the pseudoelements for the arrows was that the character wasn't wrapped around quotes. And of course, great video as always!

    • @awekeningbro1207
      @awekeningbro1207 2 года назад +1

      no, wrapping it with quotes will render the string itself