Skip to content

Commit b482417

Browse files
committed
Add: loader animation
1 parent f4f74f3 commit b482417

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

css_loader/base.css

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,59 @@ html {
6868
}
6969

7070

71+
72+
.loader-wrapper {
73+
height: 100%;
74+
display: flex;
75+
align-items: center;
76+
justify-content: center;
77+
align-content: center;
78+
}
79+
80+
.loader-animation {
81+
margin: 100px auto 0;
82+
width: 50px;
83+
text-align: center;
84+
}
85+
86+
.loader-animation > div {
87+
width: 10px;
88+
height: 10px;
89+
background-color: #333;
90+
border-radius: 100%;
91+
display: inline-block;
92+
-webkit-animation: loader-bounce 1.4s infinite ease-in-out both;
93+
animation: loader-bounce 1.4s infinite ease-in-out both;
94+
}
95+
96+
.loader-animation .bounce1 {
97+
-webkit-animation-delay: -.32s;
98+
animation-delay: -.32s;
99+
}
100+
101+
.loader-animation .bounce2 {
102+
-webkit-animation-delay: -.16s;
103+
animation-delay: -.16s;
104+
}
105+
106+
@-webkit-keyframes loader-bounce {
107+
0%, 80%, 100% { -webkit-transform: scale(0) }
108+
40% { -webkit-transform: scale(1) }
109+
}
110+
111+
@keyframes loader-bounce {
112+
0%, 80%, 100% {
113+
-webkit-transform: scale(0);
114+
transform: scale(0);
115+
} 40% {
116+
-webkit-transform: scale(1);
117+
transform: scale(1);
118+
}
119+
}
120+
121+
122+
123+
71124
/* COSMETIC --------------------------------------------------------------- */
72125

73126
/* UTILITY ---------------------------------------------------------------- */

css_loader/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ <h1 class="primary-heading">CSS Loader Animation</h1>
2323
<div class="bouncing-loader__ball"></div>
2424
</div>
2525

26+
<div class="loader-wrapper">
27+
<div class="loader-animation">
28+
<div class="bounce1"></div>
29+
<div class="bounce2"></div>
30+
<div class="bounce3"></div>
31+
</div>
32+
</div>
33+
2634
</main>
2735

2836
<footer>

0 commit comments

Comments
 (0)