Ajax Loader
HTML
<!-- Hey! Today, we'll replicate the Windows Phone 7 loading animation using CSS3. The markup for it will be a simple unordered list like this -->
1
<!-- Hey! Today, we'll replicate the Windows Phone 7 loading animation using CSS3. The markup for it will be a simple unordered list like this -->
2
 
3
<ul>
4
  <li></li>
5
  <li></li>
6
  <li></li>
7
  <li></li>
8
  <li></li>
9
  <li></li>
10
</ul>
 
CSS
/* Now, first of all we'll style the background to get a soothing look */
1
/* Now, first of all we'll style the background to get a soothing look */
2
 
3
html {
4
  height: 100%;
5
  background: 
6
    linear-gradient(225deg, transparent 35%, hsla(192, 0%, 0%, 0.6)),
7
    radial-gradient(50% 50%, circle, #5ed7f6, #0489ca);
8
}
9
 
10
/* The backgorund looks perfect for now. We'll move on to styling the list and list items */
11
 
12
ul {
13
  padding: 0; margin: 135px auto 0;
14
  list-style: none;
15
  text-align: center;
16
  display: block;
17
}
18
 
19
/* Looks good. Now, we need to animate the items */
20
ul li {
21
  width: 10px;
22
  height: 10px;
23
  background-color: white;
24
  box-shadow: 0px 1px 0px rgba(0, 0, 0, 0.5);
25
  display: inline-block;
26
  border-radius: 50%;
27
  margin: 0 4px;
28
  animation: loading 5s infinite;
29
  animation-fill-mode: both;
30
  animation-timing-function: cubic-bezier(0.030, 0.615, 0.995, 0.415);
31
}
32
 
33
/* Now the animation is looking perfect. Let's add a final touch */
34
 
35
/* The animation is still not perfect. It's great but still missing the "jump" effect. So for that, we'll use a custom timing function for the animation */
36
 
37
ul li:nth-child(6) {animation-delay: 0s}
38
ul li:nth-child(5) {animation-delay: 0.2s}
39
ul li:nth-child(4) {animation-delay: 0.4s}
40
ul li:nth-child(3) {animation-delay: 0.6s}
41
ul li:nth-child(2) {animation-delay: 0.8s}
42
ul li:nth-child(1) {animation-delay: 1.0s}
43
 
44
/* Now, we need to move the lis items as in the original animation */
45
/* It's good, the only thing left is adding some delay for all list items */
46
@keyframes loading {
47
  0% {transform: translateX(-30px); opacity: 0}
48
  25% {opacity: 1}
49
  50% {transform: translateX(30px); opacity: 0}
50
  100% {opacity: 0}
51
}
52
 
53
/* That's it! Thanks for watching the tutorial :) */
54
 
55
 
56
 
57
 
58
 
59
 
60
 
 

Windows Phone 7 Loading Animation Codecast

CSSDeck G+