UNPKG

soma.js

Version:

soma.js is a javascript framework created to build scalable and maintainable applications.

49 lines (40 loc) 1.38 kB
// Generated by CoffeeScript 1.6.2 (function() { (function(clock) { "use strict"; return clock.NeedleSeconds = (function() { function NeedleSeconds() { this.seconds = 0; this.radius = 0; this.center = 0; this.size = 0; } NeedleSeconds.prototype.initialize = function(radius) { this.radius = radius; this.center = this.radius / 2; return this.size = this.center * 0.8; }; NeedleSeconds.prototype.update = function(seconds) { this.seconds = seconds; }; NeedleSeconds.prototype.draw = function(context) { var theta, x, y; theta = 6 * Math.PI / 180; x = this.center + this.size * Math.cos(this.seconds * theta - Math.PI / 2); y = this.center + this.size * Math.sin(this.seconds * theta - Math.PI / 2); context.save(); context.lineWidth = 2; context.strokeStyle = '#015666'; context.lineJoin = 'round'; context.lineCap = 'round'; context.beginPath(); context.moveTo(x, y); context.lineTo(this.center, this.center); context.closePath(); context.stroke(); return context.restore(); }; NeedleSeconds.prototype.dispose = function() {}; return NeedleSeconds; })(); })(window.clock = window.clock || {}); }).call(this);