Skip to content

Instantly share code, notes, and snippets.

@alexmwalker
Created March 14, 2012 20:52
Show Gist options
  • Select an option

  • Save alexmwalker/2039421 to your computer and use it in GitHub Desktop.

Select an option

Save alexmwalker/2039421 to your computer and use it in GitHub Desktop.
Untitled
#court{
width:1000px;
height:200px;
border:3px #f00 dotted;
position:relative;
cursor:"hand";
background:cyan}
#trench{width:10px;
height:300px;
border:0px #000 dotted;
position:relative;
overflow:scroll
}
#bat{width:10px;
height:60px;
position:relative;
background:green;
top:20%
}
#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;
}
#ball:hover #target{
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;margin-left:0px;margin-top:0px}
3% {width: 1500px;height: 600px;margin-left:-740px;margin-top:-290px}
98% {width: 1500px;height: 600px;margin-left:-740px;margin-top:-290px}
99% {width: 20px;height: 20px;margin-left:0px;margin-top:0px}
}
<!-- content to be placed inside <body>…</body> -->
<div id="court">
<div id="trench">
<div id="inner">sdfsdf
<div id="bat">
</div>
</div>
</div>
<div id="ball">
<div id="target"></div>
</div>
</div>
<p>sdfsdf</p>
{"view":"split","seethrough":"","prefixfree":"1","page":"html"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment