-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathskeletize.css
143 lines (124 loc) · 4.58 KB
/
skeletize.css
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
/** Skeletize styles */
.skeletize-container {
display: flex;
flex-direction: column;
position: absolute;
z-index: 2;
width: 100%;
height: 100%;
}
.skeletize-part {
background: transparent;
position: absolute;
z-index: 3;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.skeletize-part.skeletize-bg {
background: #f0f0f0;
}
.skeletize-part:after {
content: '';
position: absolute;
z-index: 2;
top: 0;
width: 100%;
height: 100%;
animation: slide 1s infinite;
overflow: hidden;
background: transparent;
}
.skeletize-on-load {
overflow: hidden;
}
.skeletize-part.skeletize-bg:after,
.skeletize-on-load:after {
content: '';
position: absolute;
z-index: 3;
top: 0;
width: 100%;
height: 100%;
animation: slide 1s infinite;
overflow: hidden;
/*
CSS Gradient - complete browser support from http://www.colorzilla.com/gradient-editor/
*/
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(128,186,232,0) 99%, rgba(125,185,232,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(50%,rgba(255,255,255,0.8)), color-stop(99%,rgba(128,186,232,0)), color-stop(100%,rgba(125,185,232,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#007db9e8',GradientType=1 ); /* IE6-9 */
}
.skeletize-on-load:before {
content: '';
position: absolute;
z-index: 2;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: #ededed;
}
@mixin rotate-forever {
0% { @include transform(rotate(0deg)); }
100% { @include transform(rotate(360deg)); }
}
@-webkit-keyframes rotate-forever { @include rotate-forever; }
@-moz-keyframes rotate-forever { @include rotate-forever; }
@keyframes rotate-forever { @include rotate-forever; }
.skeletize-part.spinner:after {
content: '';
border: 2px solid rgba(0,0,0,.45);
border-right-color: transparent;
border-radius: 50%;
display: inline-block;
position: absolute;
top: 50%;
left: 50%;
margin-top: -10px;
margin-left: -10px;
@include animation-duration($speed);
@include animation-iteration-count(infinite);
@include animation-name(rotate-forever);
@include animation-timing-function(linear);
@include size(20px);
}
.skeletize-header {
height: 60px;
background: #ededed;
position: relative;
}
.skeletize-header:after {
content: '';
position: absolute;
z-index: 2;
top: 0;
width: 100%;
height: 100%;
animation: slide 1s infinite;
/*
CSS Gradient - complete browser support from http://www.colorzilla.com/gradient-editor/
*/
background: -moz-linear-gradient(left, rgba(255,255,255,0) 0%, rgba(255,255,255,0.8) 50%, rgba(128,186,232,0) 99%, rgba(125,185,232,0) 100%); /* FF3.6+ */
background: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0)), color-stop(50%,rgba(255,255,255,0.8)), color-stop(99%,rgba(128,186,232,0)), color-stop(100%,rgba(125,185,232,0))); /* Chrome,Safari4+ */
background: -webkit-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* Chrome10+,Safari5.1+ */
background: -o-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* Opera 11.10+ */
background: -ms-linear-gradient(left, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* IE10+ */
background: linear-gradient(to right, rgba(255,255,255,0) 0%,rgba(255,255,255,0.8) 50%,rgba(128,186,232,0) 99%,rgba(125,185,232,0) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#00ffffff', endColorstr='#007db9e8',GradientType=1 ); /* IE6-9 */
}
.skeletize-body {
display: flex;
flex: 1;
align-items: stretch;
background-color: red;
}
@keyframes slide {
0% {transform:translateX(-100%);}
100% {transform:translateX(100%);}
}