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
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.
@@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
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)
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?
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.
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.
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?
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 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.
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??
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??
this spinner has been immediately implemented into for my project. Thanks a lot for that !
1:57 to center an item, I would prefer a display: grid; and place-items: center; These are just two lines instead of three.
OMG I saved 2 bytes!
Sometimes it doesn't work. It's better to use flex.
@@ronakexe Flex doesn't work.
This was great. Thank you very much. You did me a big favor with this tutorial and the accompanying codepen. Thank you man.
3:06 instead of specifying a width and a height, you can just specify a width and then an aspect-ratio: 1;
1:36 instead of specifying top, left, width & height you can just say inset: 0;
loader.addEventListener("transitionend", () => {
document.body.removeChild(loader);
can be removed it's not needed.
Thanks, main idea is cleared. Good luck.
Thank you, i will add this spinner in my project.
Thank you so much for this video,was really looking for this kind of video
Cool. Last part gave me some awesome ideas.
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
Thanks. So helpful
very nice! easy to understand and follow
amazing loading spinner!
He’s redoing the old one, just better
wooow awesome thank you so very much my friend... was wondering how i could add a loader to my Laravel app. but this solved
Thanks mate !
nice and easy! , thank you
Thank you sir!
thanks
Good video. Thank you very much
Thank you very much bro..
Big thank for this video
Nice video
Thank you !
Amazing thanks
Always valuable content
You are amazing ,thank you a lot✨
Super cool thanks
Was good until you add js.
Very good 👍🏻❤️
Yeah
it's amazing thank you
thanks alot
If my site is using a Master Page, do I need to do anything different? I cannot get it to work.
is there a way to make the loading page fade away when the requests is done because there's some requests still pending.
You are the best
Mom, I kinda like this guy.
kudos brother
Very nice :D Thx
Awesome!
What font are you using for vs code
Lovely!
thnks .brdh
terimakasih, thanks :)
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.
Try this => document.body.removeChild(document.body.firstChild);
2:15 Instead of #333333, you could just say #333 to get the same gray.
Instead of commenting, you should have published a tutorial!
@@angladephil he is making a note. Why would he make a tutorial if he can comment a tip which is faster?
loader--hidden is giving console error "Uncaught TypeError: Cannot read properties of null (reading 'classList')"
0:09 9:44 NOT a CSS only page loader.
is the event listener javascript or jquery? I need to create a loading spinner for a student project but has to be css only
Remember that jQuery is written in JavaScript. Event listeners are part of JavaScript
@@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
Is DOMcontenLoaded a better pick instead of windowLoad
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)
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?
Hi sir, my page has showing only image and not loading
nice thx u
You're welcome!
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.
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.
My page loaded very fast ... that's why loader is not visible...🥲 Then what i have to do ??
@@jetalsavani2799 Go to the network tab of your dev tools and choose throttling. Select slow 3G and you will see the loader.
Thanks ☺️
Nice... same issue here. Thought I was going crazy, but easy fix.
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?
I had that error too. This worked for me:
loader.addEventListener("transitionend", () => {
loader.remove()
})
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?
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)
@@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.
@@BenjaminAster specificity
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??
yeah same did you get a solution ?
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??
See my comment above
Try this => document.body.removeChild(document.body.firstChild);
class="loader" doesn't change to class="loader loader--hidden" pls help i'm trying to fix this for few hours
There is an issue with the javascript
Why don't you just make the display of the loader to be none after the page has loaded?
So it can fade with transition
does not work
Cause u're dumb
promosm
Thanks man
You're welcome!