Animated CSS loader

Developer
Size
5,053 Kb
Views
4,048

How do I make an animated css loader?

What is a animated css loader? How do you make a animated css loader? This script and codes were developed by Tommie Hansen on 28 January 2023, Saturday.

Animated CSS loader Previews

Animated CSS loader - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Animated CSS loader</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <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! */ .loading { width: 20px; height: 20px; transform: rotate(45deg); animation: loading-ani1 4s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}
.loading i { width: 20px; height: 20px; display: inline-block; border-radius: 0.3rem; position: absolute;
}
.loading i:nth-child(1) { background: #ef5350; transform: translate(0, 0); animation: loading-ani2 4s ease-in-out infinite;
}
.loading i:nth-child(2) { background: #42a5f5; transform: rotate(90deg) translate(0, 0); animation: loading-ani3 6s ease-in-out infinite;
}
.loading i:nth-child(3) { background: #ffca28; transform: rotate(180deg) translate(0, 0); animation: loading-ani4 8s ease-in-out infinite;
}
.loading i:nth-child(4) { background: #5c6bc0; transform: rotate(270deg) translate(0, 0); animation: loading-ani5 10s ease-in-out infinite;
}
@keyframes loading-ani1 { 25% { transform: rotate(135deg); } 50% { transform: rotate(225deg); } 75% { transform: rotate(315deg); } 100% { transform: rotate(405deg); }
}
@keyframes loading-ani2 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: translate(0, 40px); }
}
@keyframes loading-ani3 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(90deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(90deg) translate(0, 40px); }
}
@keyframes loading-ani4 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(180deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(180deg) translate(0, 40px); }
}
@keyframes loading-ani5 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(270deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(270deg) translate(0, 40px); }
}
body { margin: 0; background: #fafafa;
}
.container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
/* LESS MATERIAL COLOR VARs */ </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <div class="container">	<div class="loading"><i></i><i></i><i></i><i></i></div>
</div>
</body>
</html>

Animated CSS loader - Script Codes CSS Codes

.loading { width: 20px; height: 20px; transform: rotate(45deg); animation: loading-ani1 4s cubic-bezier(0.165, 0.84, 0.44, 1) infinite;
}
.loading i { width: 20px; height: 20px; display: inline-block; border-radius: 0.3rem; position: absolute;
}
.loading i:nth-child(1) { background: #ef5350; transform: translate(0, 0); animation: loading-ani2 4s ease-in-out infinite;
}
.loading i:nth-child(2) { background: #42a5f5; transform: rotate(90deg) translate(0, 0); animation: loading-ani3 6s ease-in-out infinite;
}
.loading i:nth-child(3) { background: #ffca28; transform: rotate(180deg) translate(0, 0); animation: loading-ani4 8s ease-in-out infinite;
}
.loading i:nth-child(4) { background: #5c6bc0; transform: rotate(270deg) translate(0, 0); animation: loading-ani5 10s ease-in-out infinite;
}
@keyframes loading-ani1 { 25% { transform: rotate(135deg); } 50% { transform: rotate(225deg); } 75% { transform: rotate(315deg); } 100% { transform: rotate(405deg); }
}
@keyframes loading-ani2 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: translate(0, 40px); }
}
@keyframes loading-ani3 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(90deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(90deg) translate(0, 40px); }
}
@keyframes loading-ani4 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(180deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(180deg) translate(0, 40px); }
}
@keyframes loading-ani5 { 17.5%, 25%, 42.5%, 50%, 67.5%, 75%, 92.5%, 100% { transform: rotate(270deg) translate(0, 0); } 12.5%, 37.5%, 62.5%, 87.5% { transform: rotate(270deg) translate(0, 40px); }
}
body { margin: 0; background: #fafafa;
}
.container { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
}
/* LESS MATERIAL COLOR VARs */
Animated CSS loader - Script Codes
Animated CSS loader - Script Codes
Home Page Home
Developer Tommie Hansen
Username tommiehansen
Uploaded January 28, 2023
Rating 3
Size 5,053 Kb
Views 4,048
Do you need developer help for Animated CSS loader?

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!

Tommie Hansen (tommiehansen) Script Codes
Create amazing blog posts 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!