Permalink
Browse files

Removed gradients on wells for touch devices, moved timer

  • Loading branch information...
1 parent ce637b1 commit 0f991b5759cb0c8bd7f61248ab8f794a91b63a09 @cham committed Jun 24, 2012
Showing with 40 additions and 29 deletions.
  1. +5 −3 index.html
  2. +35 −26 src/Emitter.js
View
@@ -47,11 +47,13 @@
}
.hud-target {
left: 360px;
- color: #99f;
+ color: #99F;
+ width: 114px;
+ text-align: right;
}
.hud-timeleft {
- left: 7px;
- top: 18px;
+ left: 434px;
+ top: 23px;
}
.hud-saved.somesaved {
color: #0f0;
View
@@ -418,7 +418,8 @@ define(['lib/isTouchDevice'],function(isTouchDevice){
drawGravityWells: function(){
var self = this,
delta = (this.drawCount % 100) / 100,
- wellRgb = '';
+ wellRgb = '',
+ outerWellRadius;
this.ctx.lineWidth = 2;
_(this.gravityWells).each(function(well){
@@ -430,32 +431,40 @@ define(['lib/isTouchDevice'],function(isTouchDevice){
self.ctx.closePath();
self.ctx.stroke();
- self.ctx.strokeStyle = wellRgba+(delta*0.1)+")";
- self.ctx.beginPath();
- self.ctx.arc(well[0], well[1], well[2]*100*(1-delta), 0, Math.PI*2, true);
- self.ctx.closePath();
- self.ctx.stroke();
+ outerWellRadius = well[2]*100*(1-delta);
- grd = self.ctx.createRadialGradient(well[0], well[1], 0, well[0], well[1], 150);
- grd.addColorStop(0, wellRgba+"0.15)");
- grd.addColorStop(0.5, wellRgba+"0.1)");
- grd.addColorStop(1, wellRgba+"0)");
- self.ctx.beginPath();
- self.ctx.arc(well[0], well[1], 400, 0, Math.PI*2, true);
- self.ctx.closePath();
- self.ctx.fillStyle = grd;
- self.ctx.fill();
-
- grd = self.ctx.createRadialGradient(well[0], well[1], 0, well[0], well[1], well[2]*80);
- grd.addColorStop(0, "rgba(0,0,0,0)");
- grd.addColorStop(0.5, "rgba(0,0,0,0.4)");
- grd.addColorStop(0.85, "rgba(0,0,0,0)");
- grd.addColorStop(1, "rgba(0,0,0,0)");
- self.ctx.beginPath();
- self.ctx.arc(well[0], well[1], well[2]*80, 0, Math.PI*2, true);
- self.ctx.closePath();
- self.ctx.fillStyle = grd;
- self.ctx.fill();
+ if(outerWellRadius>20){
+ self.ctx.strokeStyle = wellRgba+(delta*0.3)+")";
+ self.ctx.beginPath();
+ self.ctx.arc(well[0], well[1], outerWellRadius, 0, Math.PI*2, true);
+ self.ctx.closePath();
+ self.ctx.stroke();
+ }
+
+ if(!isTouchDevice){
+
+ grd = self.ctx.createRadialGradient(well[0], well[1], 0, well[0], well[1], 150);
+ grd.addColorStop(0, wellRgba+"0.15)");
+ grd.addColorStop(0.5, wellRgba+"0.1)");
+ grd.addColorStop(1, wellRgba+"0)");
+ self.ctx.beginPath();
+ self.ctx.arc(well[0], well[1], 400, 0, Math.PI*2, true);
+ self.ctx.closePath();
+ self.ctx.fillStyle = grd;
+ self.ctx.fill();
+
+ grd = self.ctx.createRadialGradient(well[0], well[1], 0, well[0], well[1], well[2]*80);
+ grd.addColorStop(0, "rgba(0,0,0,0)");
+ grd.addColorStop(0.5, "rgba(0,0,0,0.4)");
+ grd.addColorStop(0.85, "rgba(0,0,0,0)");
+ grd.addColorStop(1, "rgba(0,0,0,0)");
+ self.ctx.beginPath();
+ self.ctx.arc(well[0], well[1], well[2]*80, 0, Math.PI*2, true);
+ self.ctx.closePath();
+ self.ctx.fillStyle = grd;
+ self.ctx.fill();
+
+ }
});
},

0 comments on commit 0f991b5

Please sign in to comment.