How to Create a CSS Page Loading Spinner - Web Design Tutorial

  Рет қаралды 76,855

dcode

dcode

Күн бұрын

Пікірлер: 91
@TomasMisura
@TomasMisura 2 жыл бұрын
this spinner has been immediately implemented into for my project. Thanks a lot for that !
@BenjaminAster
@BenjaminAster 2 жыл бұрын
1:57 to center an item, I would prefer a display: grid; and place-items: center; These are just two lines instead of three.
@sicfxmusic
@sicfxmusic 2 жыл бұрын
OMG I saved 2 bytes!
@ronakexe
@ronakexe Жыл бұрын
Sometimes it doesn't work. It's better to use flex.
@DaMu24
@DaMu24 Жыл бұрын
@@ronakexe Flex doesn't work.
@howinooz
@howinooz 2 жыл бұрын
This was great. Thank you very much. You did me a big favor with this tutorial and the accompanying codepen. Thank you man.
@BenjaminAster
@BenjaminAster 2 жыл бұрын
1:36 instead of specifying top, left, width & height you can just say inset: 0;
@BenjaminAster
@BenjaminAster 2 жыл бұрын
3:06 instead of specifying a width and a height, you can just specify a width and then an aspect-ratio: 1;
@ForfeitStudios
@ForfeitStudios Жыл бұрын
loader.addEventListener("transitionend", () => { document.body.removeChild(loader); can be removed it's not needed.
@ianonline
@ianonline Жыл бұрын
This looks great and it all makes sense, however it's not working for me, the screen just stays blank. Could it be because I'm masking the URL? The frame loads but after loading Dev Tools says
@ДмитрийХарченко-ю5с
@ДмитрийХарченко-ю5с 2 жыл бұрын
Thanks, main idea is cleared. Good luck.
@ck0024
@ck0024 2 жыл бұрын
Cool. Last part gave me some awesome ideas.
@oyuncubirlii
@oyuncubirlii 2 жыл бұрын
amazing loading spinner!
@benubaba9349
@benubaba9349 2 жыл бұрын
Thank you, i will add this spinner in my project.
@siyavats6892
@siyavats6892 Жыл бұрын
Thank you so much for this video,was really looking for this kind of video
@valona4432
@valona4432 Жыл бұрын
What font are you using for vs code
@M7ilan
@M7ilan Жыл бұрын
is there a way to make the loading page fade away when the requests is done because there's some requests still pending.
@brucew4545
@brucew4545 Жыл бұрын
If my site is using a Master Page, do I need to do anything different? I cannot get it to work.
@PunhwarCoding
@PunhwarCoding 7 ай бұрын
Nice video
@backend_pinpost
@backend_pinpost Жыл бұрын
Thanks. So helpful
@codeaxen
@codeaxen 2 жыл бұрын
wooow awesome thank you so very much my friend... was wondering how i could add a loader to my Laravel app. but this solved
@husseincode
@husseincode 2 жыл бұрын
Very good 👍🏻❤️
@RazifMohamed
@RazifMohamed 2 жыл бұрын
very nice! easy to understand and follow
@digvijayyamagekar4300
@digvijayyamagekar4300 Жыл бұрын
nice and easy! , thank you
@tpzd1063
@tpzd1063 2 жыл бұрын
He’s redoing the old one, just better
@atouchofa.d.d.5852
@atouchofa.d.d.5852 2 жыл бұрын
Always valuable content
@fazhari675
@fazhari675 8 ай бұрын
Thanks mate !
@NurioonSoftware
@NurioonSoftware Жыл бұрын
Good video. Thank you very much
@yuthcambo3712
@yuthcambo3712 Жыл бұрын
Big thank for this video
@VocalCove
@VocalCove Жыл бұрын
Thank you very much bro..
@sahirmmmdova5052
@sahirmmmdova5052 2 жыл бұрын
You are amazing ,thank you a lot✨
@aaronmoroney2066
@aaronmoroney2066 2 жыл бұрын
is the event listener javascript or jquery? I need to create a loading spinner for a student project but has to be css only
@dcode-software
@dcode-software 2 жыл бұрын
Remember that jQuery is written in JavaScript. Event listeners are part of JavaScript
@aaronmoroney2066
@aaronmoroney2066 2 жыл бұрын
@@dcode-software Thank you, I've just noticed in the course brief it says to just make it disappear after three seconds, and not after page load. it's just an intro in css animations I'm studying. thank you for getting back to me so quickly
@hassaneoutouaya
@hassaneoutouaya 2 жыл бұрын
Thank you !
@shahidhsalarzai
@shahidhsalarzai 2 жыл бұрын
hi should we use javascript cdn? i am facing the following exception Uncaught DOMException: Failed to execute 'removeChild' on 'Node': The node to be removed is not a child of this node.
@jamesmassa1999
@jamesmassa1999 2 жыл бұрын
Try this => document.body.removeChild(document.body.firstChild);
@BenjaminAster
@BenjaminAster 2 жыл бұрын
5:32 I have never understood this .loader--hidden naming convention. Why not just say .loader.hidden and then specify the "hidden" class in JavaScript?
@dcode-software
@dcode-software 2 жыл бұрын
It's BEM. Having it as it's own class means your styles can be specific to the element you are trying to modify (in this case hide)
@BenjaminAster
@BenjaminAster 2 жыл бұрын
@@dcode-software Ok but why don't just say .loader.hidden instead of .loader--hidden? That would also only apply to a .loader element with the class of .hidden.
@ck0024
@ck0024 2 жыл бұрын
@@BenjaminAster specificity
@mr7oda3
@mr7oda3 2 жыл бұрын
it's amazing thank you
@fola_azeez
@fola_azeez 8 ай бұрын
Amazing thanks
@allanfernz9356
@allanfernz9356 2 жыл бұрын
Is DOMcontenLoaded a better pick instead of windowLoad
@dcode-software
@dcode-software 2 жыл бұрын
DOM Content Loaded triggers once the document has been loaded (like the "skeleton") but Window On Load is when everything is loaded (e.g. includes images)
@Stallion45
@Stallion45 2 жыл бұрын
In regards to the spinner and the page load…, if I have a lot of images on the page, or the visitor is on a slow connection, can I make this loader only display while image content in the view is not loaded…, then display as items further down the page load?
@yeomkyeokyeo
@yeomkyeokyeo 2 жыл бұрын
Super cool thanks
@kortisnet2315
@kortisnet2315 Жыл бұрын
loader--hidden is giving console error "Uncaught TypeError: Cannot read properties of null (reading 'classList')"
@archangel_one
@archangel_one Жыл бұрын
0:09 9:44 NOT a CSS only page loader.
@chiroaksun8737
@chiroaksun8737 2 жыл бұрын
Very nice :D Thx
@stephenoluwafemiherbert
@stephenoluwafemiherbert 2 жыл бұрын
You are the best
@yusufakkurt2308
@yusufakkurt2308 2 жыл бұрын
Awesome!
@Syedfarooque280
@Syedfarooque280 Жыл бұрын
Hi sir, my page has showing only image and not loading
@smoothbeak
@smoothbeak 2 жыл бұрын
Lovely!
@BenjaminAster
@BenjaminAster 2 жыл бұрын
2:15 Instead of #333333, you could just say #333 to get the same gray.
@angladephil
@angladephil 2 жыл бұрын
Instead of commenting, you should have published a tutorial!
@softwarelivre2389
@softwarelivre2389 2 жыл бұрын
@@angladephil he is making a note. Why would he make a tutorial if he can comment a tip which is faster?
@homeoffice3524
@homeoffice3524 Жыл бұрын
Was good until you add js.
@wisdomugochukwu2249
@wisdomugochukwu2249 Жыл бұрын
Thanks man
@dcode-software
@dcode-software Жыл бұрын
You're welcome!
@lvekua
@lvekua 2 жыл бұрын
It removes the loader however console shows following error: Uncaught DOMException: Node.removeChild: The node to be removed is not a child of this node - any suggestions?
@najmantube
@najmantube Жыл бұрын
I had that error too. This worked for me: loader.addEventListener("transitionend", () => { loader.remove() })
@sulemanmughal5397
@sulemanmughal5397 2 жыл бұрын
kudos brother
@bitter_tech_facts
@bitter_tech_facts Жыл бұрын
thanks alot
@PeriklesPeriklesoglu
@PeriklesPeriklesoglu Жыл бұрын
thanks
@michalkichal2436
@michalkichal2436 Жыл бұрын
class="loader" doesn't change to class="loader loader--hidden" pls help i'm trying to fix this for few hours
@myriamleclerc846
@myriamleclerc846 Жыл бұрын
I paste everything but when i put the loader--hidden in the html my loading spinner just gets hidden for good. And if i don't put it it's just fixed everywhere. Does anyone has had the same problem??
@malikzeeshan7365
@malikzeeshan7365 Жыл бұрын
yeah same did you get a solution ?
@tyscyre2256
@tyscyre2256 2 жыл бұрын
Why don't you just make the display of the loader to be none after the page has loaded?
@dcode-software
@dcode-software 2 жыл бұрын
So it can fade with transition
@antonwahyudi2441
@antonwahyudi2441 2 жыл бұрын
terimakasih, thanks :)
@wujeonghyun6865
@wujeonghyun6865 Жыл бұрын
Mom, I kinda like this guy.
@bryanthompson1070
@bryanthompson1070 2 жыл бұрын
Nice simple little loader. Great video, thanks. I had two problems with it though. As mentioned by Lara below, I got the 'failed to removeChild on Node' error message. For some reason, transitionEnd fires twice so the code tries to remove the node after it's already been removed. I fixed this with: loader.addEventListener("transitionend", () => { if (document.querySelector(".loader")) { document.body.removeChild(loader) } }) The second problem was I have some dynamically added text elements (checkmark & x) that were showing through the loader. I fixed this by setting the z-index on .loader to 100.
@laraliyn
@laraliyn 2 жыл бұрын
I solved the problem by adding a seperate js file to the project.But I think according to what I have read, adding script before body in html creates such a problem.I hope this helps.
@jetalsavani2799
@jetalsavani2799 2 жыл бұрын
My page loaded very fast ... that's why loader is not visible...🥲 Then what i have to do ??
@bryanthompson1070
@bryanthompson1070 2 жыл бұрын
@@jetalsavani2799 Go to the network tab of your dev tools and choose throttling. Select slow 3G and you will see the loader.
@jetalsavani2799
@jetalsavani2799 2 жыл бұрын
Thanks ☺️
@Stallion45
@Stallion45 2 жыл бұрын
Nice... same issue here. Thought I was going crazy, but easy fix.
@CARTOON-d1b6i
@CARTOON-d1b6i Жыл бұрын
thnks .brdh
@laraliyn
@laraliyn 2 жыл бұрын
After I added this spinner, everything worked fine. Although loader is removed from page flow, still in the console, "Uncaught DOMException: Failed to execute 'removeChild' on 'Node " error message shows up. Is there anyone has the same problem??
@bryanthompson1070
@bryanthompson1070 2 жыл бұрын
See my comment above
@jamesmassa1999
@jamesmassa1999 2 жыл бұрын
Try this => document.body.removeChild(document.body.firstChild);
@GravityFrag
@GravityFrag Жыл бұрын
nice thx u
@dcode-software
@dcode-software Жыл бұрын
You're welcome!
@Hyper_Futbuss
@Hyper_Futbuss Жыл бұрын
Yeah
@deancorbyn
@deancorbyn Жыл бұрын
There is an issue with the javascript
@DaMu24
@DaMu24 Жыл бұрын
does not work
@Fr0sT_is_Playing
@Fr0sT_is_Playing 8 ай бұрын
Cause u're dumb
@hermankeller1071
@hermankeller1071 2 жыл бұрын
promosm
@beegoodb1213
@beegoodb1213 11 ай бұрын
Thank you sir!
Navbar CSS Tutorial: 3 Ways to Create a Navigation Bar with Flexbox
15:08
4 Ways To Center Elements with CSS
7:15
dcode
Рет қаралды 22 М.
Create a horizontal media scroller with CSS
26:13
Kevin Powell
Рет қаралды 307 М.
Color Changing Shiny Loader using HTML & CSS
4:32
CodingNepal
Рет қаралды 79 М.
Learn CSS Flexbox in 20 Minutes (Course)
20:37
Coding2GO
Рет қаралды 356 М.
How To Create Skeleton Loading Animation With CSS
9:59
Web Dev Simplified
Рет қаралды 304 М.
Learn CSS Grid the easy way
37:04
Kevin Powell
Рет қаралды 951 М.
Subtle, yet Beautiful Scroll Animations
5:04
Beyond Fireship
Рет қаралды 1,8 МЛН