Skip to content

Instantly share code, notes, and snippets.

@ui2code
Created November 27, 2014 05:42
Show Gist options
  • Save ui2code/89c24711f25171952380 to your computer and use it in GitHub Desktop.
Save ui2code/89c24711f25171952380 to your computer and use it in GitHub Desktop.
CSS3 corrida
<div class="carros"></div>
.carros{
background:#ccc;
border-top:10px double #999;
border-bottom:10px double #999;
width:300px;
height:32px;
margin:40px auto;
position:relative;
}
.carros:before,
.carros:after{
content:'';
display:block;
width:50px;
height:20px;
opacity:0;
position:absolute;
}
.carros:before{
background:red;
top:-15px;
-webkit-animation:transition 2s ease infinite;
-webkit-animation-delay:0.5s;
}
.carros:after{
background:blue;
bottom:-15px;
-webkit-animation:transition 2s ease infinite;
-webkit-animation-delay:1s;
}
@-webkit-keyframes transition{
0%{opacity:0; -webkit-transform:translateX(-50px);}
50%{opacity:1;}
100%{opacity:0; -webkit-transform:translateX(300px);}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment