Created
April 1, 2013 02:39
-
-
Save ozinepank/5282943 to your computer and use it in GitHub Desktop.
Cross-Browser Animations
animations that works across Firefox, Chrome, Opera, and IE10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.polling_message { | |
color:white; | |
float:left; | |
margin-right:2%; | |
} | |
.view_port { | |
background-color:black; | |
height:25px; | |
width:100%; | |
overflow: hidden; | |
} | |
.cylon_eye { | |
color:white; | |
height: 100%; | |
width: 20%; | |
background-color: red; | |
background-image: -webkit-linear-gradient(left, rgba( 0,0,0,0.9 ) 25%, rgba( 0,0,0,0.1 ) 50%, rgba( 0,0,0,0.9 ) 75%); | |
background-image: -moz-linear-gradient(left, rgba( 0,0,0,0.9 ) 25%, rgba( 0,0,0,0.1 ) 50%, rgba( 0,0,0,0.9 ) 75%); | |
background-image: -ms-linear-gradient(left, rgba( 0,0,0,0.9 ) 25%, rgba( 0,0,0,0.1 ) 50%, rgba( 0,0,0,0.9 ) 75%); | |
background-image: -o-linear-gradient(left, rgba( 0,0,0,0.9 ) 25%, rgba( 0,0,0,0.1 ) 50%, rgba( 0,0,0,0.9 ) 75%); | |
background-image: linear-gradient(to right, rgba( 0,0,0,0.9 ) 25%, rgba( 0,0,0,0.1 ) 50%, rgba( 0,0,0,0.9 ) 75%); | |
-webkit-animation: move_eye 4s linear 0s infinite alternate; | |
-moz-animation: move_eye 4s linear 0s infinite alternate; | |
-ms-animation: move_eye 4s linear 0s infinite alternate; | |
-o-animation: move_eye 4s linear 0s infinite alternate; | |
animation: move_eye 4s linear 0s infinite alternate; | |
} | |
@-webkit-keyframes move_eye { from { margin-left:-20%; } to { margin-left:100%; } } | |
@-moz-keyframes move_eye { from { margin-left:-20%; } to { margin-left:100%; } } | |
@-ms-keyframes move_eye { from { margin-left:-20%; } to { margin-left:100%; } } | |
@-o-keyframes move_eye { from { margin-left:-20%; } to { margin-left:100%; } } | |
@keyframes move_eye { from { margin-left:-20%; } to { margin-left:100%; } } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="view_port"> | |
<div class="polling_message"> | |
Listening for dispatches | |
</div> | |
<div class="cylon_eye"></div> | |
</div> | |
/* Demo: https://developer.mozilla.org/en-US/docs/CSS/animation#Browser_compatibility */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment