Gmail like loading animation in pure CSS

Developer
Size
2,845 Kb
Views
123,464

How do I make an gmail like loading animation in pure css?

This animation is similar to what GMail shows at the starting of loading one's email id. This animation is made purely in CSS and using just one element so it can be used on any DOM element by just toggling the class. Just a fun note, GMail only shows the inner stripes animation on Chrome, but not on Firefox. Here is a POC that it is possible :). What is a gmail like loading animation in pure css? How do you make a gmail like loading animation in pure css? This script and codes were developed by Girish Sharma on 02 August 2022, Tuesday.

Gmail like loading animation in pure CSS Previews

Gmail like loading animation in pure CSS - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Gmail like loading animation in pure CSS</title> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ /* Demo specific styles begin */
body { background: rgb(245,245,245);
}
b { position: absolute; top: calc(50% - 26px); left: 50%; transform: translateX(-50%); font-family: arial,sans-serif;
}
.loader-gmail { position: absolute; top: calc(50% - 6px); left: calc(50% - 160px);
}
a { font-family: arial,sans-serif; font-weight: 600; font-size: 0.9rem; text-decoration: none; position: fixed; bottom: 0; right: 0; margin: 5px; color: #333;
}
a:hover { color: #777;
}
/* Demo specific styles end */
.loader-gmail { border: 1px solid #a4a4a4; width: 320px; height: 8px; background-image: linear-gradient(135deg, #6187f2 0%, #6187f2 25%, #5679da 25%, #5679da 50%, #6187f2 50%, #6187f2 75%, #5679da 75%, #5679da 100%); background-repeat: repeat; background-position: 0px 0px; background-size: 16px 16px; background-clip: content-box; padding: 1px; animation: loading 1s linear infinite;
}
.loader-gmail:after { position: absolute; right: 0; height: 8px; background: rgb(245,245,245); z-index: 20; animation: progress 4s ease-in-out infinite; content: '';
}
@keyframes loading { from { background-position: 0px 0px; } to { background-position: -16px 0px; }
}
@keyframes progress { 0% { min-width: 100%; } 30% { min-width: 80%; } 50% { min-width: 65%; } 69% { min-width: 20%; } 85% { min-width: 0; } 100% { min-width: 0; }
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <b>Loading [email protected]...</b>
<div class="loader-gmail"></div>
<a href="http://codepen.io/collection/khwrE">See my other interesting loaders in pure CSS</a>
</body>
</html>

Gmail like loading animation in pure CSS - Script Codes CSS Codes

/* Demo specific styles begin */
body { background: rgb(245,245,245);
}
b { position: absolute; top: calc(50% - 26px); left: 50%; transform: translateX(-50%); font-family: arial,sans-serif;
}
.loader-gmail { position: absolute; top: calc(50% - 6px); left: calc(50% - 160px);
}
a { font-family: arial,sans-serif; font-weight: 600; font-size: 0.9rem; text-decoration: none; position: fixed; bottom: 0; right: 0; margin: 5px; color: #333;
}
a:hover { color: #777;
}
/* Demo specific styles end */
.loader-gmail { border: 1px solid #a4a4a4; width: 320px; height: 8px; background-image: linear-gradient(135deg, #6187f2 0%, #6187f2 25%, #5679da 25%, #5679da 50%, #6187f2 50%, #6187f2 75%, #5679da 75%, #5679da 100%); background-repeat: repeat; background-position: 0px 0px; background-size: 16px 16px; background-clip: content-box; padding: 1px; animation: loading 1s linear infinite;
}
.loader-gmail:after { position: absolute; right: 0; height: 8px; background: rgb(245,245,245); z-index: 20; animation: progress 4s ease-in-out infinite; content: '';
}
@keyframes loading { from { background-position: 0px 0px; } to { background-position: -16px 0px; }
}
@keyframes progress { 0% { min-width: 100%; } 30% { min-width: 80%; } 50% { min-width: 65%; } 69% { min-width: 20%; } 85% { min-width: 0; } 100% { min-width: 0; }
}
Gmail like loading animation in pure CSS - Script Codes
Gmail like loading animation in pure CSS - Script Codes
Home Page Home
Developer Girish Sharma
Username grssam
Uploaded August 02, 2022
Rating 4.5
Size 2,845 Kb
Views 123,464
Do you need developer help for Gmail like loading animation in pure CSS?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Girish Sharma (grssam) Script Codes
Create amazing Facebook ads with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!