Skip to content

Instantly share code, notes, and snippets.

@rod-dot-codes
Created September 29, 2016 19:07
Show Gist options
  • Save rod-dot-codes/68395253951dd31c04db9d404b7a0f03 to your computer and use it in GitHub Desktop.
Save rod-dot-codes/68395253951dd31c04db9d404b7a0f03 to your computer and use it in GitHub Desktop.
.loaders-container {
padding: 20px;
margin: 0 auto;
width: 700px;
text-align: center;
font-size: 0;
.container {
position: relative;
display: inline-block;
box-sizing: border-box;
padding: 30px;
width: 25%;
height: 140px;
}
}
.box {
position: relative;
box-sizing: border-box;
border: 4px solid #FFF;
width: 80px;
height: 80px;
animation: spin 3s infinite linear;
&:before {
content: '';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
box-sizing: border-box;
border: 4px solid #FFF;
width: 60px;
height: 60px;
animation: pulse 1.5s infinite ease;
}
}
.line {
position: absolute;
top: 50%;
margin-left: 10px;
width: 60px;
height: 4px;
background: #FFF;
animation: spin 1.5s infinite ease;
&:nth-of-type(2) { animation-delay: 0.1s; }
&:nth-of-type(3) { animation-delay: 0.2s; }
&:nth-of-type(4) { animation-delay: 0.3s; }
}
.circle {
box-sizing: border-box;
width: 80px;
height: 80px;
border-radius: 100%;
border: 10px solid rgba(255, 255, 255, 0.2);
border-top-color: #FFF;
animation: spin 1s infinite linear;
}
.wave {
margin-top: 15px;
float: left;
width: 18px;
height: 40px;
box-sizing: border-box;
border: 2px solid #FFF;
margin-left: -2px;
animation: slide 0.6s infinite linear;
&:first-child {
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
&:last-child {
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
&:nth-child(2n+1) {
animation-delay: 0.3s;
}
}
.circleloader {
position: absolute;
box-sizing: border-box;
top: 50%;
margin-top: -10px;
border-radius: 16px;
width: 80px;
height: 20px;
padding: 4px;
background: rgba(255, 255, 255, 0.4);
&:before {
content: '';
position: absolute;
border-radius: 16px;
width: 20px;
height: 12px;
left: 0;
background: #FFF;
animation: push 1s infinite linear;
}
}
.switchbox {
position: relative;
height: 80px;
animation: spin 2s infinite linear;
.switch {
position: absolute;
top: 50%;
margin-top: -10px;
width: 20px;
height: 20px;
background: #FFF;
border-radius: 20px;
animation: cross 2s infinite linear;
&:nth-of-type(2) {
animation-delay: -1s;
}
}
}
.bouncybox {
height: 100px;
width: 40px;
margin-left: 20px;
.bouncy {
width: 40px;
height: 40px;
border-radius: 20px;
background: #ecf0f1;
animation: bouncy 2s infinite ease-in-out;
}
}
@keyframes bouncy {
40% {
height: 40px;
}
50% {
transform: translate(0, 65px);
height: 34px;
border-radius: 20px;
}
65% {
height: 40px;
}
}
@keyframes push {
50% {
left: 56px;
}
}
@keyframes slide {
50% {
margin-top: 25px;
}
}
@keyframes pulse {
50% {
border-width: 30px;
}
}
@keyframes spin {
100% {
transform: rotate(360deg);
}
}
@keyframes cross {
50% {
margin-left: 60px;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment