Skip to content

Instantly share code, notes, and snippets.

@fixlr
Created July 2, 2010 14:02
Show Gist options
  • Select an option

  • Save fixlr/461402 to your computer and use it in GitHub Desktop.

Select an option

Save fixlr/461402 to your computer and use it in GitHub Desktop.
Pure html/css activity animation for webkit browsers
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>untitled</title>
<style type="text/css" media="screen">
.spinner {
width: 250px;
height: 50px;
margin: 4em auto;
}
.spinner div {
background: #000;
float: left;
width: 4px;
height: 4px;
margin: 22px 10px 0 31px;
opacity: 0.3;
-webkit-border-radius: 2px;
-webkit-animation-duration: 1.5s;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: ease-in-out;
}
.spinner div:nth-child(1) {
-webkit-animation-name: webkit-resize1;
}
.spinner div:nth-child(2) {
-webkit-animation-name: resize2;
}
.spinner div:nth-child(3) {
-webkit-animation-name: resize3;
}
.spinner div:nth-child(4) {
-webkit-animation-name: resize4;
}
.spinner div:nth-child(5) {
-webkit-animation-name: resize5;
}
@-webkit-keyframes webkit-resize1 {
0% {
-webkit-transform:scale(1);
}
20% {
-webkit-transform:scale(3);
opacity: 0.8;
}
40% {
-webkit-transform:scale(1.5);
}
60% {
-webkit-transform:scale(1);
}
80% {
-webkit-transform:scale(1);
}
100% {
-webkit-transform:scale(1);
}
}
@-webkit-keyframes resize2 {
0% {
-webkit-transform:scale(1);
}
20% {
-webkit-transform:scale(1.5);
}
40% {
-webkit-transform:scale(3);
opacity: 0.8;
}
60% {
-webkit-transform:scale(1.5);
}
80% {
-webkit-transform:scale(1);
}
100% {
-webkit-transform:scale(1);
}
}
@-webkit-keyframes resize3 {
0% {
-webkit-transform:scale(1);
}
20% {
-webkit-transform:scale(1);
}
40% {
-webkit-transform:scale(1.5);
}
60% {
-webkit-transform:scale(3);
opacity: 0.8;
}
80% {
-webkit-transform:scale(1.5);
}
100% {
-webkit-transform:scale(1);
}
}
@-webkit-keyframes resize4 {
0% {
-webkit-transform:scale(1.5);
}
20% {
-webkit-transform:scale(1);
}
40% {
-webkit-transform:scale(1);
}
60% {
-webkit-transform:scale(1.5);
}
80% {
-webkit-transform:scale(3);
opacity: 0.8;
}
100% {
-webkit-transform:scale(1.5);
}
}
@-webkit-keyframes resize5 {
0% {
-webkit-transform:scale(1.5);
}
20% {
-webkit-transform:scale(1);
}
40% {
-webkit-transform:scale(1);
}
60% {
-webkit-transform:scale(1);
}
80% {
-webkit-transform:scale(1.5);
}
100% {
-webkit-transform:scale(3);
opacity: 0.8;
}
}
</style>
</head>
<body>
<div class="spinner">
<div class="one"></div>
<div class="two"></div>
<div class="three"></div>
<div class="four"></div>
<div class="five"></div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment