Created
September 18, 2012 14:01
-
-
Save Ultrabenosaurus/3743293 to your computer and use it in GitHub Desktop.
CSS Animations clock with seconds, minutes and hours
This file contains 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
.loader{ | |
color: #555; | |
font-family: sans-serif; | |
font-size: 3em; | |
text-align: center; | |
-webkit-border-radius: 50%; | |
border-radius: 50%; | |
border: 5px solid #555; | |
width:100px; | |
height:100px; | |
position:relative; | |
} | |
.center{ | |
position: absolute; | |
width:100px; | |
height:100px; | |
text-align: center; | |
margin-top: 6px; | |
color: black; | |
} | |
.second-hand{ | |
position: absolute; | |
width:100px; | |
height:100px; | |
text-align: center; | |
color: red !important; | |
-webkit-animation: rotateit 60s linear infinite; | |
-moz-animation: rotateit 60s linear infinite; | |
animation: rotateit 60s linear infinite; | |
} | |
.minute-hand{ | |
position: absolute; | |
width:100px; | |
height:100px; | |
text-align: center; | |
color: black !important; | |
-webkit-animation: rotateit 3600s linear infinite; | |
-moz-animation: rotateit 3600s linear infinite; | |
animation: rotateit 3600s linear infinite; | |
} | |
.hour-hand{ | |
position: absolute; | |
width:100px; | |
height:100px; | |
text-align: center; | |
-webkit-animation: rotateit 86400s linear infinite; | |
-moz-animation: rotateit 86400s linear infinite; | |
animation: rotateit 86400s linear infinite; | |
} | |
@-webkit-keyframes rotateit { | |
from { | |
-webkit-transform: rotate(0deg); | |
} | |
to { | |
-webkit-transform: rotate(360deg); | |
} | |
} | |
@-moz-keyframes rotateit { | |
from { | |
-moz-transform: rotate(0deg); | |
} | |
to { | |
-moz-transform: rotate(360deg); | |
} | |
} | |
@keyframes rotateit { | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
} |
This file contains 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
<!-- expanded version of this loader animation: https://gist.github.com/3743065 --> | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset='utf-8' /> | |
<title>CSS Clock</title> | |
</head> | |
<body> | |
<div class="loader"> | |
<div class='second-hand'>I</div> | |
<div class='minute-hand'>I</div> | |
<div class='hour-hand'>I</div> | |
<div class='center'>.</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment