An Interest In:
Web News this Week
- April 25, 2024
- April 24, 2024
- April 23, 2024
- April 22, 2024
- April 21, 2024
- April 20, 2024
- April 19, 2024
May 9, 2020 05:51 am GMT
Original Link: https://dev.to/starbist/making-a-wait-widget-using-a-pseudo-element-and-css-step-animation-66k
Making a wait widget using a pseudo-element and CSS Step Animation
Here's my approach to making a wait widget:
- using a pseudo-element after,
- using keyframes for animation,
- using steps for changing states,
- using
infinite
to make a loop, - using
content
to change the animation text.
Here's the code:
.waiting { position: relative; &:after { content: "Waiting."; position: absolute; top: 0; right: 0; bottom: 0; left: 0; display: flex; align-items: center; justify-content: center; background-color: rgba(255,255,255,.75); color: Tomato; animation: waiting 3s steps(3, end) infinite; } }@keyframes waiting { 33% { content: "Waiting.."; } 66% { content: "Waiting..."; }}
Original Link: https://dev.to/starbist/making-a-wait-widget-using-a-pseudo-element-and-css-step-animation-66k
Share this article:
Tweet
View Full Article
Dev To
An online community for sharing and discovering great ideas, having debates, and making friendsMore About this Source Visit Dev To