Skip to content

Instantly share code, notes, and snippets.

@leovafme
Created March 6, 2018 19:43
Show Gist options
  • Select an option

  • Save leovafme/a0d570a87a60b06eaa71933de4e2bac2 to your computer and use it in GitHub Desktop.

Select an option

Save leovafme/a0d570a87a60b06eaa71933de4e2bac2 to your computer and use it in GitHub Desktop.
animation css line bar
<!DOCTYPE html>
<html>
<head>
<style>
div {
width: 35px;
height: 10px;
border-radius: 5px;
background: red;
position: relative;
-webkit-animation: mymove 1s infinite; /* Safari 4.0 - 8.0 */
-webkit-animation-timing-function: linear; /* Safari 4.0 - 8.0 */
animation: mymove 1s infinite;
animation-timing-function: linear;
}
/* Safari 4.0 - 8.0 */
@-webkit-keyframes mymove {
from {left: 0px;}
to {left: 200px;}
0% {
background-color: red;
opacity: 0.1;
}
25% {
background-color: yellow;
opacity: 1;
}
50% {background-color: blue;}
100% {
background-color: green;
opacity: 0.0;
}
}
@keyframes mymove {
from {left: 0px;}
to {left: 200px;}
0% {
background-color: red;
opacity: 0.1;
}
25% {
background-color: yellow;
opacity: 1;
}
50% {background-color: blue;}
100% {
background-color: green;
opacity: 0.0;
}
}
</style>
</head>
<body>
<div></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment