Created
March 12, 2012 11:43
-
-
Save alexmwalker/2021341 to your computer and use it in GitHub Desktop.
Untitled
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
| #court{ | |
| width:1000px; | |
| height:300px; | |
| border:3px #000 dotted; | |
| position:relative} | |
| #target{ | |
| width:20px; | |
| height:20px; | |
| outline:1px red dashed; | |
| position:absolute; | |
| background:rgba(255,0,0,.2) | |
| } | |
| #ball{ | |
| width:20px;height:20px;border-radius:20px; | |
| background:red; | |
| position:absolute; | |
| } | |
| #target:hover{ | |
| animation: target 2.7s infinite linear; | |
| } | |
| #target:hover #ball{ | |
| animation: | |
| xstuff 2.7s linear infinite, | |
| ystuff 3.1s linear infinite | |
| } | |
| @keyframes xstuff { | |
| 0%, 100% {transform: translateX(0)} | |
| 50% {transform: translateX(1000px);} | |
| } | |
| @keyframes ystuff { | |
| 0%, 100% {margin-top: 0} | |
| 50% {margin-top: 300px;} | |
| } | |
| @keyframes target { | |
| 0% {width: 20px;height: 20px} | |
| 2% {width: 20px;height: 20px} | |
| 3% {width: 1000px;height: 300px} | |
| 98% {width: 1000px;height: 300px} | |
| 99% {width: 20px;height: 20px} | |
| } |
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
| <!-- content to be placed inside <body>…</body> --> | |
| <div id="court"> | |
| <div id="ball"> | |
| <div id="target"></div> | |
| </div> | |
| </div> |
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
| {"view":"split","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment