Last active
July 4, 2016 06:16
-
-
Save martinkean/9758393fbcbe2ff924bde36ac49738ab to your computer and use it in GitHub Desktop.
Ball
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
/** | |
* Ball | |
*/ | |
/* These exercises are for teaching purposes only. */ | |
/* With thanks to Val Head and Lynda.com for providing the code and images http://www.lynda.com/CSS-tutorials/CSS-Animations/115434-2.html */ | |
body {margin: 6em 10%; background:#493F5B;} | |
.ball { | |
position: absolute; | |
top: 400px; | |
background: url(http://martinkean.com/kidscon/ball/ball2.png) no-repeat; | |
width: 111px; | |
height: 111px; | |
animation-name: bouncing-ball; | |
animation-duration: 2s; | |
animation-iteration-count: infinite; | |
animation-fill-mode: both; | |
animation-direction: alternate;} | |
@keyframes bouncing-ball { | |
0% {transform: translateY(-200px) rotate(2turn); animation-timing-function: ease-in;} | |
100% {transform:translateY(0px) rotate(.5turn); animation-timing-function: ease-out;} | |
} |
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 class="ball"></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
// alert('Hello world!'); |
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","fontsize":"100","seethrough":"","prefixfree":"1","page":"css"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment