<!DOCTYPE html>
<html lang="en">
<head>
<!-- -------------------- Created By InCoder -------------------- -->
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Loader With Check Mark Animation - InCoder</title>
<link rel="stylesheet" href="main.css">
</head>
<body>
<input type="checkbox" id="loader">
<label for="loader">
<div class="check"></div>
</label>
</body>
</html>
/* -------------------- Created By InCoder -------------------- */
body {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: #202020;
}
input {
display: none;
}
input:checked~label {
animation: none;
transition: border 0.5s ease-out;
}
input:checked~label .check {
display: block;
}
label {
width: 7rem;
height: 7rem;
position: relative;
border-radius: 50%;
border: 2px solid #ccc;
border-left: 2px solid #472db9;
animation: spin 1.2s linear infinite, colorChange 3s linear infinite;
}
label .check {
top: 50%;
left: 23px;
width: 28px;
content: "";
height: 56px;
display: none;
position: absolute;
transform-origin: left top;
animation: check 0.8s ease;
border-top: 4px solid #5cb85c;
border-right: 4px solid #5cb85c;
transform: scaleX(-1) rotate(135deg);
}
@keyframes check {
0% {
height: 0;
width: 0;
opacity: 1;
}
20% {
height: 0;
width: 28px;
opacity: 1;
}
40% {
height: 56px;
width: 28px;
opacity: 1;
}
100% {
height: 56px;
width: 28px;
opacity: 1;
}
}
@keyframes colorChange {
40% {
border-left: 2px solid #2db981;
}
60% {
border-left: 2px solid #b97f2d;
}
80% {
border-left: 2px solid #b92db2;
}
100% {
border-left: 2px solid #b92d2d;
}
}
@keyframes spin {
100% {
transform: rotate(360deg);
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.