How To Create Skeleton Loading Animation With CSS

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ย. 2024

ความคิดเห็น • 211

  • @Zeilar
    @Zeilar 3 ปีที่แล้ว +136

    This is precisely what I needed, was just about to make some of these tomorrow lol!

  • @solvedfyi
    @solvedfyi 3 ปีที่แล้ว +4

    I'm just here to give props for when the topic is specific, straightforward, and not clickbait. We can't just comment on the negative

  • @camc6864
    @camc6864 3 ปีที่แล้ว +11

    Your consistent new videos are so refreshing. I knew I made the right decision subscribing mate. Thank you Kyle ❤️

  • @edwardyakovich2053
    @edwardyakovich2053 3 ปีที่แล้ว +11

    Cool tutorial, I dig it. I've been using something pretty similar for years, which has worked great. I use a "data-attibute" approach and the :empty CSS pseudo-class.
    So, on the parent DIV that you're loading stuff into, have a data-attr, examples such as: data-skeleton-load="full" or data-skeleton-load="table" or data-skeleton-load="card" or data-skeleton-load="form".
    Basically just keep the parent DIV empty until the data loads in, and while empty, the css loading animation will occur from one of your loading templates.
    Kinda same idea, just a little different.

  • @brijspy
    @brijspy 3 ปีที่แล้ว +16

    Wow!! haven't thought it was so simple. Thanks for this Kyle :)

  • @ayushniroula1781
    @ayushniroula1781 3 ปีที่แล้ว +30

    Exactly what I needed to know right now. Thank you you are awesome

  • @krux02
    @krux02 3 ปีที่แล้ว +6

    The most important part to get your site fast is to bundle everything in a static page. Do not send an empty page to the end user with lots of javascrit that then starts to incrementally load one element at a time with many API requests. That is how you get to 90s internet performance.

  • @arneg4588
    @arneg4588 3 ปีที่แล้ว +5

    funny how this is the last thing to a big intranet dashboard page where sometimes its good to have something like a skeleton loading, perfect timing master web :D

  • @cleaningspy
    @cleaningspy 3 ปีที่แล้ว +4

    Thanks kyle. Before I have no idea about Skeleton!

  • @husseinkizz
    @husseinkizz 3 ปีที่แล้ว +1

    I wanted this kind of stuff from your channel a year ago, but now I have it. I have been doing it the hard way, thanks for simplfying the web!

  • @chetan3283
    @chetan3283 3 ปีที่แล้ว +5

    Looked so simple yet so effective! Thanks for sharing this.. keep doing these things!
    So much to learn on every topic :)

  • @recoder1111
    @recoder1111 3 ปีที่แล้ว +147

    Isn't leaving the animation still on after the contents have loaded bad for the performance? I thought animation increases CPU usage.

    • @justpatrick_
      @justpatrick_ 3 ปีที่แล้ว +7

      I agree. Css animation use a lot of cpu

    • @Italiafani
      @Italiafani 3 ปีที่แล้ว +123

      @@OdyssME Emptying the grid only clears out the placeholder cards. There are no animations on the grid element itself. The skeleton text animations are not a problem, since he replaced the contents of the title and body of the card, clearing the animated placeholder divs. However, the image still has the animation going on after it's loaded. To disable this behaviour, you could do something like:
      const img = div.querySelector('img')
      img.addEventListener('load', () => {
      img.classList.remove('skeleton')
      }, { once: true })

    • @jamjam3448
      @jamjam3448 3 ปีที่แล้ว +4

      @@Italiafani excellent bro!

    • @OdyssME
      @OdyssME 3 ปีที่แล้ว

      @@Italiafani You're right, I have omitted the skeleton class left in the image.

    • @narudesigns
      @narudesigns 3 ปีที่แล้ว +6

      Exactly what I was thinking. Maybe we can toggle the class the classList method in javascript before and after the actual data has been loaded like
      element.classList.toggle("skeleton");

  • @colinm3130
    @colinm3130 3 ปีที่แล้ว +1

    After watching this video I just implemented it on an app I am working on at work. I used some very different settings, but this video inspired me to give it a whirl. Because it's an internal tool and there is a very fast load time it wasn't totally needed, but I had a fun time trying it out. Thanks for this video!

  • @TheDmNtd
    @TheDmNtd 3 ปีที่แล้ว +2

    Couldn't have come at a better time, I needed this at work! :D

  • @avivperets7360
    @avivperets7360 4 หลายเดือนก่อน

    As allways you coming right on time, exactly when i wonder how to implement it well haha,
    Thanks again man!

  • @Skalexsong
    @Skalexsong 3 ปีที่แล้ว +8

    Exactly what I need, very simple, understandable and so accurate. Thank you so much !

  • @pauljohn3898
    @pauljohn3898 3 ปีที่แล้ว

    This is absolutely great, I noticed youtube video has a loading animationa and wondered how it works and your video is recommended by TH-cam. So GREAT.

  • @blankdeepspace1488
    @blankdeepspace1488 3 ปีที่แล้ว +1

    Just thought about it yesterday and today it's here. Thanks Kyle 👍

  • @anticsBack
    @anticsBack 3 ปีที่แล้ว +5

    Awesome content as always, thank you Kyle!

  • @paulreyesdigital
    @paulreyesdigital 3 ปีที่แล้ว +3

    I was just thinking about this one, Thank you for this ❤

  • @TecheremHizz
    @TecheremHizz 3 ปีที่แล้ว +2

    This is what I was searching for Thankx bro❤️

  • @lucienchu9649
    @lucienchu9649 2 ปีที่แล้ว

    I was eager to know how it does previously. Then the trick part is that, you better know how many contents (cards) you gonna populate, or simply fill the view port with cards, kind of brutal. Great content !

  • @NNNedlog
    @NNNedlog 3 ปีที่แล้ว +2

    Thanks a lot for this. I was legit thinking about learning how to implement this on my site

  • @quickwebtutorials4312
    @quickwebtutorials4312 3 ปีที่แล้ว

    I didn't even know how to search this thing. Thank you Kayle.

  • @darkmift
    @darkmift 3 ปีที่แล้ว +1

    Very nice and concise.
    Would love to see more css shorts like this.

  • @Jolterix20
    @Jolterix20 3 ปีที่แล้ว

    Okay I'm sure you're reading my mind. First with stripe and now this. Thanks so much man!!

  • @cryptogap5559
    @cryptogap5559 3 ปีที่แล้ว +1

    Your videos are awesome! Thank you for doing these. I’ve watched so many of them.

  • @xKond3i
    @xKond3i 3 ปีที่แล้ว +2

    As always - great tutorial. 😍
    Thank You so much, it might be useful in future projects.

  • @lethe_yoon
    @lethe_yoon ปีที่แล้ว

    I exactly understood your video and implemented skeleton UIs myself. Thank you

  • @adnanahad
    @adnanahad 3 ปีที่แล้ว +1

    Wonderful
    Waiting for long time for the right video....

  • @teyjingwoon
    @teyjingwoon 3 ปีที่แล้ว +1

    Thanks the great content. I’m doing some page content loading this works better then loading bar

  • @braumski2
    @braumski2 8 หลายเดือนก่อน

    I didn't know you could throttle the speed, that is awesome

  • @PythonExploratorium
    @PythonExploratorium 10 หลายเดือนก่อน

    Love your video man!
    From Nigeria...

  • @alexkail3
    @alexkail3 3 ปีที่แล้ว +1

    Excellent video! Thanks for sharing this. Very handy. 👍🏼👍🏼

  • @peter9759
    @peter9759 10 หลายเดือนก่อน

    Easy Tutorial thanks really helped . Makes UX really better

  • @iamreg1965
    @iamreg1965 3 ปีที่แล้ว

    Neat idea but I still like a splash screen. Diff'rent strokes and all that eh?
    Nice work Kyle, always look forward to new content from you man.

  • @the_full_stack_junkie
    @the_full_stack_junkie 3 ปีที่แล้ว +1

    You are great dud thanks!

  • @95jugal
    @95jugal 3 ปีที่แล้ว +2

    That was a smooth implementation.

  • @jajcarzek
    @jajcarzek 3 ปีที่แล้ว

    Thanks for idea for loading screen for my frontend!

  • @yusiff
    @yusiff 2 ปีที่แล้ว

    Thanks Kyle. But it killed me when you typed "Lorem1" 😂😂

  • @omrajeshkbangalore2092
    @omrajeshkbangalore2092 7 หลายเดือนก่อน

    I've been looking for it, Thank you so much

  • @questionable-cf1tt
    @questionable-cf1tt 3 ปีที่แล้ว +1

    Another great video, thanks man!

  • @riajmazumder4434
    @riajmazumder4434 3 ปีที่แล้ว

    I was thinking about how to do that from long time. Thank you 💓

  • @bhattaraitheaxe
    @bhattaraitheaxe 3 ปีที่แล้ว

    Awesome 😎
    Love From Nepal 🇳🇵

  • @youcefg9760
    @youcefg9760 3 ปีที่แล้ว +1

    Thanks a lot for this video!

  • @AdarshSingh-qd6mq
    @AdarshSingh-qd6mq 3 ปีที่แล้ว +1

    Eagerly waiting to see right approach about preloader / skeleton loader...

    • @Hafsa0526
      @Hafsa0526 2 ปีที่แล้ว

      Hey Adarsh. Are you looking out for opportunities in software development currently? Did you work on projects related to React/Node?

    • @AdarshSingh-qd6mq
      @AdarshSingh-qd6mq 2 ปีที่แล้ว

      @@Hafsa0526 Not intrested...

  • @Arabian_Abomination
    @Arabian_Abomination 3 ปีที่แล้ว +2

    Thanks again

  • @kybkap8686
    @kybkap8686 ปีที่แล้ว

    nice its so easy to do lol. thank you
    also nice trick for dealing with data coming from the server by using cloneNode

  • @T3hIluvatar
    @T3hIluvatar 3 ปีที่แล้ว

    These videos are incredibly helpful.

  • @peterativacationonline5203
    @peterativacationonline5203 3 ปีที่แล้ว +1

    "one of the best loading experiences a user can experience" - is a reminder of what we are really telling the user: you cannot yet interact with this site. I'm glad Kyle effectively acknowledges this upfront since I have "front end devs" who think they are adding some sort of functionality to the site by using this. Still, this is good info for when it is appropriate to use.

  • @srinathsathyanath7435
    @srinathsathyanath7435 3 ปีที่แล้ว

    Kyle is on 🔥. Awesome job bro 👍👏

  • @powerseostrategy
    @powerseostrategy 2 ปีที่แล้ว

    I like your Jackson. I have 5 of them!

  • @jamjam3448
    @jamjam3448 3 ปีที่แล้ว +1

    Thanks a lot!

  • @Tayyab-g9l
    @Tayyab-g9l หลายเดือนก่อน

    bro that is amazing and i realy need that

  • @resolutionAgha
    @resolutionAgha 3 ปีที่แล้ว

    High quality information. Thank you so much

  • @slowprogrammer
    @slowprogrammer 3 ปีที่แล้ว +1

    Good one

  • @developersharif
    @developersharif 3 ปีที่แล้ว +2

    *0 dislike u deserve it!* ♥♥

  • @AreebAmir
    @AreebAmir 3 ปีที่แล้ว +1

    Hello Sir! I am Areeb. I watched your video. Appreciate it because your videos help me to make different project. But I googled a lot about how to make web hosting machine or web server. Can you tell us more about web server.

  • @juststudying1019
    @juststudying1019 ปีที่แล้ว

    It looks professional, thanks man

  • @Fooljuice
    @Fooljuice 3 ปีที่แล้ว

    Ay thanks. Very helpful

  • @mohitkumar-vm6zl
    @mohitkumar-vm6zl 3 ปีที่แล้ว

    really amazing bro how we simply we can create a skeleton loading in just few minutes

  • @keremardicli4013
    @keremardicli4013 3 ปีที่แล้ว

    So simple so nice. Well done

  • @atishchandole
    @atishchandole 3 ปีที่แล้ว +1

    You are awesome, can you make a video on Lazy Loading with image?

  • @prabhakarmishra2182
    @prabhakarmishra2182 3 ปีที่แล้ว

    You explained it very well

  • @aytacg26
    @aytacg26 ปีที่แล้ว

    Thank you very much, great explanation, I like it

  • @ayedabboushi7221
    @ayedabboushi7221 2 ปีที่แล้ว

    Many Thanks, this was really helpful.

  • @gopalloharnew5948
    @gopalloharnew5948 2 ปีที่แล้ว +1

    Great Man

  • @toluwanimiadeyemo8099
    @toluwanimiadeyemo8099 3 ปีที่แล้ว +1

    great video, thanks. What if I am not using javascript to prepopulate the fields, the loader won't work

  • @dmytrokravtsov5745
    @dmytrokravtsov5745 3 ปีที่แล้ว

    Looks great! Thank you very much.

  • @oldclient
    @oldclient 3 ปีที่แล้ว

    It's way better than those circle or linear loaders, because this will not flicker html containers when the real content will be rendered.

  • @olawuniemmanuel
    @olawuniemmanuel 9 หลายเดือนก่อน

    This is pretty straightforward but might have imapact on the performance of the code and the site

  • @prasannanaik1023
    @prasannanaik1023 3 ปีที่แล้ว +1

    Great content 👍

  • @Ayydos
    @Ayydos 3 ปีที่แล้ว +1

    amazing, thanks!

  • @dheemanthm.d3836
    @dheemanthm.d3836 3 ปีที่แล้ว +1

    Thanks for this 👍❤️

  • @qwerty-wk4pz
    @qwerty-wk4pz 3 ปีที่แล้ว +1

    Thank you

  • @shaikshavalisyed2012
    @shaikshavalisyed2012 3 ปีที่แล้ว +1

    Excellent

  • @adrienguylagrange4453
    @adrienguylagrange4453 ปีที่แล้ว

    Thank you very much my friend, this is exactly what I was looking for. Very understandable and simple. You have just gained a new subscriber

  • @tabdig
    @tabdig 3 ปีที่แล้ว +1

    Thanks mate 😄

  • @SharkBait_ZA
    @SharkBait_ZA 3 ปีที่แล้ว

    Awesome stuff, thank you Sir.

  • @rajeevkumar-si8gy
    @rajeevkumar-si8gy 3 ปีที่แล้ว +2

    I love it

  • @NNNedlog
    @NNNedlog 3 ปีที่แล้ว +1

    Thanks a lot Kyle:)

  • @vipercode4792
    @vipercode4792 ปีที่แล้ว +1

    Thanks

  • @daveglad3554
    @daveglad3554 3 ปีที่แล้ว

    TOP 👌🏽...dependent dropdown in react js 🙏

  • @vengeance9047
    @vengeance9047 3 ปีที่แล้ว +1

    This man is 🔥🔥🔥🔥🔥🔥🔥

  • @bayuidhamfathurachman1276
    @bayuidhamfathurachman1276 3 ปีที่แล้ว

    I think you just read my mind!

  • @AH-cf9cv
    @AH-cf9cv 3 ปีที่แล้ว +1

    👍👍👍 Thank u.

  • @user-ie7md3mm6x
    @user-ie7md3mm6x 3 ปีที่แล้ว

    Thank you so much! Awesome content

  • @konstantinkirichenko9863
    @konstantinkirichenko9863 3 ปีที่แล้ว

    Cool vid. Thanks bro.

  • @AlexandreTriche
    @AlexandreTriche 3 ปีที่แล้ว

    Material-UI v5 (to be released on September 1st) will include a skeleton component for all React Developers, with almost the same styles as Kyle's demo.

  • @bosmertheincredible
    @bosmertheincredible 3 ปีที่แล้ว

    Ty. Good that I subbscribed on channel a while ago =)

  • @StarOnCheek
    @StarOnCheek 3 ปีที่แล้ว +3

    5:27 there is a problem, you are making the image transparent too

    • @preciousadeyinka2786
      @preciousadeyinka2786 3 ปีที่แล้ว

      Yeah I noticed, but good thing he said in his opinion, so it's personal preference matter I guess.

    • @contradictio
      @contradictio 2 ปีที่แล้ว

      You can add opacity property on the image

  • @7h476uy
    @7h476uy 3 ปีที่แล้ว +1

    Async UI FTW!!!

  • @МихаилЧон
    @МихаилЧон 3 ปีที่แล้ว +1

    Make a tutorial how to implement subscriptions with stripe

  • @CodingAbroad
    @CodingAbroad ปีที่แล้ว +1

    The problem with this approach are the sheer number of empty divs. We as devs should be limiting the number of divs as it takes up extra memory. We should be utilising css more. Generators are there to help

    • @CodingAbroad
      @CodingAbroad ปีที่แล้ว +1

      Andy Howard css skeleton screen generator

  • @vishwanath-ts
    @vishwanath-ts 3 ปีที่แล้ว +2

    0 dislikes, humanity still exists!!

    • @insideTheDiv
      @insideTheDiv 3 ปีที่แล้ว

      😁❤️

    • @vishwanath-ts
      @vishwanath-ts 3 ปีที่แล้ว

      @Dylan O'brien May be you disliked?🤨

  • @gillbates9668
    @gillbates9668 2 ปีที่แล้ว

    thanks for this video

  • @user-ug1vi3bv1f
    @user-ug1vi3bv1f 2 ปีที่แล้ว

    Thank you!

  • @nicolasrama906
    @nicolasrama906 2 ปีที่แล้ว

    Excellent!

  • @brainz80
    @brainz80 3 ปีที่แล้ว +1

    Why not use hsla instead of hsl and remove opacity. Opacity also affects the image while hsla would only affect the background-color.

  • @h.nazmulhassanrakib5058
    @h.nazmulhassanrakib5058 3 ปีที่แล้ว

    Awesome video .. thank you kyle..