How to create Skeleton Loading Animation | HTML & CSS Project - Frontend everything
Hello Everyone 👋Welcome to My New Blog. Today I have made Amazing Skeleton Loading Animation with the help of HTML and CSS Only!😍
I am Piyush, Sharing About Web development Daily. You can also check out me at @frontendeverything.
Before starting the blog, you might think about where you can use this project in real-life-based projects. So it's a Skeleton Loading that you can use in your own blog project. So it will look attractive.
Let's start making these amazing Skeleton Loading Animation Using HTML & CSS step by step.
Video of the project,
So that was the preview now let us start making the project 😄 First, we will code HTML then CSS, and also I have shared codepen ink to make it easier for you.
HTML 🎈( step - 1)
In HTML we have used divs for the cards and for the description of the cards. Skeleton loading will be done by css.
<div class="card">
<div class="image">
<img src="https://assets.codepen.io/2002878/wake-up-and-code.jpg" alt="">
</div>
<div class="content">
<h4>CodingStartup</h4>
<div class="description">
Lorem ipsum dolor, sit amet consectetur adipisicing elit. Ex quasi enim facere commodi omnis...
</div>
</div>
</div>
<div class="card loading">
<div class="image">
</div>
<div class="content">
<h4></h4>
<div class="description">
</div>
</div>
</div>
After the HTML we will design the divs and make skeleton loading animation.
Output till now
CSS🎈( step - 2)
:root {
--loading-grey: #ededed;
}
body {
background-color: #f6f6f6;
font-family: Helvetica;
font-size: 15px;
display: flex;
justify-content: space-evenly;
align-items: center;
min-height: 100vh;
}
.card {
width: 320px;
background-color: #fff;
border-radius: 6px;
overflow: hidden;
box-shadow: 0px 4px 6px rgba(0, 0, 0, .12);
}
.image {
height: 200px;
}
.image img {
display: block;
width: 100%;
height: inherit;
object-fit: cover;
}
.content {
padding: 2rem 1.8rem;
}
h4 {
margin: 0 0 1rem;
font-size: 1.5rem;
line-height: 1.5rem;
}
.description {
font-size: 1rem;
line-height: 1.4rem;
}
.loading .image,
.loading h4,
.loading .description {
background-color: var(--loading-grey);
background: linear-gradient(
100deg,
rgba(255, 255, 255, 0) 40%,
rgba(255, 255, 255, .5) 50%,
rgba(255, 255, 255, 0) 60%
) var(--loading-grey);
background-size: 200% 100%;
background-position-x: 180%;
animation: 1s loading ease-in-out infinite;
}
@keyframes loading {
to {
background-position-x: -20%;
}
}
.loading h4 {
min-height: 1.6rem;
border-radius: 4px;
animation-delay: .05s;
}
.loading .description {
min-height: 4rem;
border-radius: 4px;
animation-delay: .06s;
}
Now we have done the CSS coding as well, now we will see the final output and also check the codepen link mentioned below.
Final Output
The codepen link is here for making your work easier!
the coder of this project:
.
If you found any value in this blog you can support me by buying me a coffee.
.
.
.
.
.
Thank You For Scrolling Till here 😊. If You gain any knowledge then do checkout me at @frontendeverything. I am Piyush 🎉 I provide Content related to programming, technology, web development Daily.
.
Hi
ReplyDeleteAwesome!
Can you share one more example along with multiple card loading? I mean after the animation is done card image and the content will display.