Skip to content

Instantly share code, notes, and snippets.

@silvamerica
Created June 27, 2014 09:53
Show Gist options
  • Save silvamerica/a39222c41dc67e0a8471 to your computer and use it in GitHub Desktop.
Save silvamerica/a39222c41dc67e0a8471 to your computer and use it in GitHub Desktop.
Loader
/* light blue #37BEFF */
.loader-box {
border: 4px solid #37BEFF;
width: 44px;
height: 60px;
border-radius: 8px;
color: #FFF;
}
.loader-line {
background-color: #37BEFF;
height: 2px;
margin: 8px 4px;
border-radius: 8px;
border-top: 1px solid #37beff;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
}
.loader-line.first {
margin-top: 12px;
}
.loader-line {
-webkit-animation: slide 3s ease-in-out infinite;
animation: slide 3s ease-in-out infinite;
}
.loader-line:nth-child(1) {
-webkit-animation-delay: 0.5s;
animation-delay: 0.5s;
}
.loader-line:nth-child(2) {
-webkit-animation-delay: 00.75s;
animation-delay: 00.75s;
}
.loader-line:nth-child(3) {
-webkit-animation-delay: 1s;
animation-delay: 1s;
}
.loader-line:nth-child(4) {
-webkit-animation-delay: 1.25s;
animation-delay: 1.25s;
}
@-webkit-keyframes slide {
from, to, 70% { -webkit-transform: scale(1,1) }
20%, 40% { -webkit-transform: translateX(36px) scale(0,1); }
50% { -webkit-transform: translate(0) scale(0,1); }
}
@keyframes slide {
from, to, 70% { transform: scale(1,1) }
20%, 40% { transform: translateX(36px) scale(0,1); }
50% { transform: translate(0) scale(0,1); }
}
.loader-box-error {
-webkit-transition: color 2s, border-color 2s;
transition: color 2s, border-color 2s;
color: #E3292C;
border-color: #E3292C;
}
.loader-box-error .loader-line {
display: none;
}
.loader-error {
display: none;
}
.error .loader-error {
display: block;
font-family: Helvetica, Arial, sans-serif;
font-size: 56px;
margin: 0px 14px 8px;
}
<html>
<head>
<link rel="stylesheet" href="css/loader.css">
</head>
<body>
<div class="loader-box">
<div class="loader-line first"></div>
<div class="loader-line"></div>
<div class="loader-line"></div>
<div class="loader-line"></div>
<div class="loader-error">!</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment