Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

tilt head

  • Loading branch information...
commit 026a53d71e0f23b9aa97149d1f3a34b9f5d7d39d 1 parent c158a58
@tj authored
Showing with 19 additions and 2 deletions.
  1. +18 −1 particles/public/game.js
  2. +1 −1  particles/public/style.css
View
19 particles/public/game.js
@@ -1,2 +1,19 @@
-o = $;
+o = $;
+
+o(function(){
+
+ var head = o('#guy-head')[0]
+ , balloons = o('#balloons');
+
+ function lookat(x, y) {
+ move('#guy-head')
+ .rotate(-(x * .2))
+ .end();
+ }
+
+ setInterval(function(){
+ var off = balloons.offset();
+ lookat(off.left|0, off.top|0);
+ }, 200);
+})
View
2  particles/public/style.css
@@ -40,7 +40,7 @@ body {
}
#guy-head {
position: absolute;
- top: -38px;
+ top: -35px;
left: 40px;
width: 41px;
height: 65px;
Please sign in to comment.
Something went wrong with that request. Please try again.