-
-
Save guioconnor/4745d4995f3086c4ac6d to your computer and use it in GitHub Desktop.
JS Bin // source https://jsbin.com/defuku
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
.clock { | |
border: 2px solid black; | |
border-radius: 50%; | |
width: 16px; | |
height: 16px; | |
position: relative; | |
box-sizing: border-box; | |
background: #ccc; | |
float: left; | |
} | |
.clock2 { | |
border: 10px solid black; | |
width: 160px; | |
height: 160px; | |
} | |
.clock:hover { | |
border-color: red; | |
} | |
.clock:hover:before, | |
.clock:hover:after{ | |
background: red; | |
} | |
.clock:before | |
, | |
.clock:after | |
{ | |
top: 45%; | |
left: 50%; | |
content: ""; | |
display: block; | |
width: 10%; | |
margin-left: -5%; | |
background: black; | |
position: absolute; | |
border-radius: 500px 500px 500px 500px; | |
} | |
.clock:before { | |
height: 50%; | |
animation-duration: 4s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 10%; | |
animation-timing-function: linear; | |
} | |
.clock:after { | |
height: 40%; | |
animation-duration: 8s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 12.5%; | |
animation-timing-function: linear; | |
} | |
@keyframes clock { | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
} | |
</style> | |
</head> | |
<body> | |
<div class="clock"></div> | |
<div class="clock clock2"></div> | |
<script id="jsbin-source-css" type="text/css">.clock { | |
border: 2px solid black; | |
border-radius: 50%; | |
width: 16px; | |
height: 16px; | |
position: relative; | |
box-sizing: border-box; | |
background: #ccc; | |
float: left; | |
} | |
.clock2 { | |
border: 10px solid black; | |
width: 160px; | |
height: 160px; | |
} | |
.clock:hover { | |
border-color: red; | |
} | |
.clock:hover:before, | |
.clock:hover:after{ | |
background: red; | |
} | |
.clock:before | |
, | |
.clock:after | |
{ | |
top: 45%; | |
left: 50%; | |
content: ""; | |
display: block; | |
width: 10%; | |
margin-left: -5%; | |
background: black; | |
position: absolute; | |
border-radius: 500px 500px 500px 500px; | |
} | |
.clock:before { | |
height: 50%; | |
animation-duration: 4s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 10%; | |
animation-timing-function: linear; | |
} | |
.clock:after { | |
height: 40%; | |
animation-duration: 8s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 12.5%; | |
animation-timing-function: linear; | |
} | |
@keyframes clock { | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
}</script> | |
</body> | |
</html> |
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
.clock { | |
border: 2px solid black; | |
border-radius: 50%; | |
width: 16px; | |
height: 16px; | |
position: relative; | |
box-sizing: border-box; | |
background: #ccc; | |
float: left; | |
} | |
.clock2 { | |
border: 10px solid black; | |
width: 160px; | |
height: 160px; | |
} | |
.clock:hover { | |
border-color: red; | |
} | |
.clock:hover:before, | |
.clock:hover:after{ | |
background: red; | |
} | |
.clock:before | |
, | |
.clock:after | |
{ | |
top: 45%; | |
left: 50%; | |
content: ""; | |
display: block; | |
width: 10%; | |
margin-left: -5%; | |
background: black; | |
position: absolute; | |
border-radius: 500px 500px 500px 500px; | |
} | |
.clock:before { | |
height: 50%; | |
animation-duration: 4s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 10%; | |
animation-timing-function: linear; | |
} | |
.clock:after { | |
height: 40%; | |
animation-duration: 8s; | |
animation-name: clock; | |
animation-iteration-count: infinite; | |
transform-origin: 50% 12.5%; | |
animation-timing-function: linear; | |
} | |
@keyframes clock { | |
from { | |
transform: rotate(0deg); | |
} | |
to { | |
transform: rotate(360deg); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment