forked from jlong/css-spinners
-
Notifications
You must be signed in to change notification settings - Fork 0
/
heartbeat.scss
49 lines (42 loc) · 1.52 KB
/
heartbeat.scss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@import "compass/css3";
$heartbeat-loader-color: #e87 !default;
$heartbeat-loader-size: 36px !default; // must be an integer divisible by 2 and 3
$heartbeat-loader-rotation: rotate(45deg) !default;
@include keyframes(heartbeat-loader) {
0% { @include transform($heartbeat-loader-rotation scale(1)); }
14% { @include transform($heartbeat-loader-rotation scale(1.3)); }
28% { @include transform($heartbeat-loader-rotation scale(1)); }
42% { @include transform($heartbeat-loader-rotation scale(1.3)); }
70% { @include transform($heartbeat-loader-rotation scale(1)); }
}
/* :not(:required) hides this rule from IE9 and below */
.heartbeat-loader:not(:required) {
@include animation(heartbeat-loader 1300ms ease 0s infinite normal);
display: inline-block;
position: relative;
overflow: hidden;
text-indent: -9999px;
width: $heartbeat-loader-size;
height: $heartbeat-loader-size;
@include transform($heartbeat-loader-rotation scale(1));
@include transform-origin(50%, 50%);
&:after, &:before {
position: absolute;
content: "";
background: $heartbeat-loader-color;
}
&:before {
@include border-left-radius($heartbeat-loader-size / 3);
top: ($heartbeat-loader-size/3);
left: 0;
width: $heartbeat-loader-size;
height: (2 * $heartbeat-loader-size / 3);
}
&:after {
@include border-top-radius($heartbeat-loader-size / 3);
top: 0;
left: ($heartbeat-loader-size / 3);
width: (2 * $heartbeat-loader-size / 3);
height: ($heartbeat-loader-size / 3);
}
}