diff --git a/website/source/Gruntfile.js b/website/source/Gruntfile.js index 1d0f20f727..c1b922a036 100644 --- a/website/source/Gruntfile.js +++ b/website/source/Gruntfile.js @@ -1,69 +1,67 @@ +// jshint node:true module.exports = function(grunt) { - // Configuration goes here - grunt.initConfig({ +// Load plugins here +grunt.loadNpmTasks('grunt-contrib-less'); +grunt.loadNpmTasks('grunt-contrib-clean'); +grunt.loadNpmTasks('grunt-contrib-concat'); +grunt.loadNpmTasks('grunt-contrib-connect'); +grunt.loadNpmTasks('grunt-contrib-copy'); +grunt.loadNpmTasks('grunt-contrib-uglify'); +grunt.loadNpmTasks('grunt-contrib-watch'); +grunt.loadNpmTasks('grunt-recess'); - less: { - development:{ - files: { - "stylesheets/main.css": "stylesheets/main.less" - } +// Configuration goes here +grunt.initConfig({ + + less: { + development:{ + files: { + "stylesheets/main.css": "stylesheets/main.less" } - }, - - concat: { - options: { - separator: ';' - }, - site: { - src: [ - 'javascripts/app/app.js', - 'javascripts/app/util.js', - 'javascripts/app/homepage.js' - - ], - - dest: 'javascripts/app/deploy/site.js' - }, - }, - - uglify: { - app: { - files: { - 'javascripts/app/deploy/site.min.js': ['javascripts/app/deploy/site.js'] - } - } - }, - - watch: { - less: { - files: 'stylesheets/*.less', - tasks: ['less'] - }, - js: { - files: 'javascripts/app/*.js', - tasks: ['concat', 'uglify'] - } } + }, - }); + concat: { + options: { + separator: ';' + }, + site: { + src: [ + 'javascripts/app/app.js', + 'javascripts/app/util.js', + 'javascripts/app/homepage.js' + ], + dest: 'javascripts/app/deploy/site.js' + }, + }, - // Load plugins here - grunt.loadNpmTasks('grunt-contrib-less'); - grunt.loadNpmTasks('grunt-contrib-clean'); - grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-contrib-connect'); - grunt.loadNpmTasks('grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-contrib-uglify'); - grunt.loadNpmTasks('grunt-contrib-watch'); - grunt.loadNpmTasks('grunt-recess'); + uglify: { + app: { + files: { + 'javascripts/app/deploy/site.min.js': ['javascripts/app/deploy/site.js'] + } + } + }, - // JS distribution task. - grunt.registerTask('dist-js', ['concat', 'uglify']); + watch: { + less: { + files: 'stylesheets/*.less', + tasks: ['less'] + }, + js: { + files: 'javascripts/app/*.js', + tasks: ['concat', 'uglify'] + } + } - // Full distribution task. - grunt.registerTask('dist', ['dist-js']); +}); - grunt.registerTask('default', ['watch']); +// JS distribution task. +grunt.registerTask('dist-js', ['concat', 'uglify']); + +// Full distribution task. +grunt.registerTask('dist', ['dist-js']); +grunt.registerTask('default', ['watch']); }; diff --git a/website/source/images/bg-galaxy.jpg b/website/source/images/bg-galaxy.jpg new file mode 100644 index 0000000000..638b3471fd Binary files /dev/null and b/website/source/images/bg-galaxy.jpg differ diff --git a/website/source/images/bg-static.png b/website/source/images/bg-static.png new file mode 100644 index 0000000000..a6c5296efc Binary files /dev/null and b/website/source/images/bg-static.png differ diff --git a/website/source/images/logo-static.png b/website/source/images/logo-static.png new file mode 100644 index 0000000000..76140aeef6 Binary files /dev/null and b/website/source/images/logo-static.png differ diff --git a/website/source/index.html.erb b/website/source/index.html.erb index a796b8a42c..04e04e7745 100644 --- a/website/source/index.html.erb +++ b/website/source/index.html.erb @@ -1,20 +1,9 @@
-
-
-

- Service discovery and configuration made easy. - Distributed, highly available, and - datacenter-aware. -

-
- - -
-
+
+

Build, Combine, and Launch Infrastucture

+
diff --git a/website/source/javascripts/app/Engine.Particle.Fixed.js b/website/source/javascripts/app/Engine.Particle.Fixed.js new file mode 100644 index 0000000000..530edad9cc --- /dev/null +++ b/website/source/javascripts/app/Engine.Particle.Fixed.js @@ -0,0 +1,77 @@ +(function( + Particle, + Engine, + Vector +){ + +Particle.Fixed = function(width, height){ + var targetX, targetY; + + this.radius = Engine.getRandomFloat(0.1, 1); + // this.fillA = 'rgba(136,67,237,' + Engine.getRandomFloat(0.4, 0.5) + ')'; + // this.fillB = 'rgba(136,67,237,' + Engine.getRandomFloat(0.51, 0.6) + ')'; + this.fillA = '#3a1066'; + this.fillB = '#561799'; + this.frameMax = Engine.getRandomInt(4, 10); + + this.max = { + x: width + this.maxRadius, + y: height + this.maxRadius + }; + + this.min = { + x: 0 - this.maxRadius, + y: 0 - this.maxRadius + }; + + targetX = Engine.getRandomInt(0 + this.radius, width + this.radius); + targetY = Engine.getRandomInt(0 + this.radius, height + this.radius); + + this.pos = new Vector(targetX, targetY); +}; + +Engine.Particle.Fixed.prototype = { + + radius: 1, + + pos: { + x: 0, + y: 0 + }, + + frame: 0, + showA: false, + + update: function(engine){ + this.frame++; + if (this.frame > this.frameMax) { + this.frame = 0; + this.showA = !this.showA; + } + return this; + }, + + draw: function(ctx, scale){ + // Draw a circle - far less performant + ctx.beginPath(); + ctx.arc( + this.pos.x * scale >> 0, + this.pos.y * scale >> 0, + this.radius * scale, + 0, + Math.PI * 2, + false + ); + if (this.showA) { + ctx.fillStyle = this.fillA; + } else { + ctx.fillStyle = this.fillB; + } + ctx.fill(); + + return this; + } + +}; + +})(window.Engine.Particle, window.Engine, window.Vector); diff --git a/website/source/javascripts/app/Engine.Particle.js b/website/source/javascripts/app/Engine.Particle.js new file mode 100644 index 0000000000..6666ac8c97 --- /dev/null +++ b/website/source/javascripts/app/Engine.Particle.js @@ -0,0 +1,154 @@ +(function( + Engine, + Vector +){ + +Engine.Particle = function(width, height){ + var side, targetX, targetY; + this.accel = Vector.coerce(this.accel); + this.vel = Vector.coerce(this.vel); + this.pos = new Vector(0, 0); + + this.maxRadius = Engine.getRandomFloat(0.1, 2.5); + // this.maxSpeed = Engine.getRandomFloat(0.01, 1000); + this.maxSpeed = Engine.getRandomFloat(20, 1000); + + // Pick a random target + side = Engine.getRandomInt(0, 3); + if (side === 0 || side === 2) { + targetY = (side === 0) ? -(height / 2) : (height / 2); + targetX = Engine.getRandomInt(-(width / 2), width / 2); + } else { + targetY = Engine.getRandomInt(-(height / 2), height / 2); + targetX = (side === 3) ? -(width / 2) : (width / 2); + } + + this.target = new Vector(targetX, targetY); + this.getAccelVector(); + + this.maxDistance = this.distanceTo(this.target); + + this.fillA = '#8750c2'; + this.fillB = '#b976ff'; + this.frameMax = Engine.getRandomInt(1, 5); +}; + +Engine.Particle.prototype = { + + radius: 1, + + frame: 0, + showA: false, + + accel: { + x: 0, + y: 0 + }, + + vel: { + x: 0, + y: 0 + }, + + pos: { + x: 0, + y: 0 + }, + + opacity: 1, + + maxSpeed: 1500, + maxForce: 1500, + + getAccelVector: function(){ + this.accel = Vector.sub(this.target, this.pos) + .normalize() + .mult(this.maxSpeed); + }, + + update: function(engine){ + var distancePercent, halfWidth, halfHeight; + + this.vel + .add(this.accel) + .limit(this.maxSpeed); + + this.pos.add(Vector.mult(this.vel, engine.tick)); + + halfWidth = engine.width / 2 + this.maxRadius; + halfHeight = engine.height / 2 + this.maxRadius; + + if ( + this.pos.x < -(halfWidth) || + this.pos.x > halfWidth || + this.pos.y < -(halfHeight) || + this.pos.y > halfHeight + ) { + this.kill(engine); + } + + distancePercent = (this.maxDistance - this.distanceTo(this.target)) / this.maxDistance; + this.radius = Math.max(0.1, this.maxRadius * distancePercent); + + this.frame++; + if (this.frame > this.frameMax) { + this.frame = 0; + this.showA = !this.showA; + } + + if (this.showA) { + engine.particlesA[engine.particlesA.length] = this; + } else { + engine.particlesB[engine.particlesB.length] = this; + } + + return this; + }, + + draw: function(ctx, scale){ + if (this.radius < 0.25) { + return; + } + + if (this.showA) { + ctx.fillStyle = this.fillA; + } else { + ctx.fillStyle = this.fillB; + } + + // Draw a square - very performant + ctx.fillRect( + this.pos.x * scale >> 0, + this.pos.y * scale >> 0, + this.radius * scale, + this.radius * scale + ); + + // Draw a circle - far less performant + // ctx.beginPath(); + // ctx.arc( + // this.pos.x * scale, + // this.pos.y * scale, + // this.radius * scale, + // 0, + // Math.PI * 2, + // false + // ); + // ctx.fill(); + + return this; + }, + + kill: function(engine){ + engine._deferredParticles.push(this); + return this; + }, + + distanceTo: function(target) { + var xd = this.pos.x - target.x; + var yd = this.pos.y - target.y; + return Math.sqrt(xd * xd + yd * yd ); + } +}; + +})(window.Engine, window.Vector); diff --git a/website/source/javascripts/app/Engine.Point.Puller.js b/website/source/javascripts/app/Engine.Point.Puller.js new file mode 100644 index 0000000000..910093a604 --- /dev/null +++ b/website/source/javascripts/app/Engine.Point.Puller.js @@ -0,0 +1,153 @@ +(function( + Engine, + Vector +){ + +Engine.Point.Puller = function(id, x, y, shapeSize){ + this.id = id; + + this.shapeSize = shapeSize; + this.ref = new Vector(x, y); + + this.pos = new Vector( + x * shapeSize.x, + y * shapeSize.y + ); + + this.home = this.pos.clone(); + this.accel = Vector.coerce(this.accel); + this.vel = Vector.coerce(this.vel); +}; + +Engine.Point.Puller.prototype = { + + fillStyle: null, + defaultFillstyle: '#b976ff', + chasingFillstyle: '#ff6b6b', + + radius: 1, + + maxSpeed: 160, + maxForce: 50, + + pos: { + x: 0, + y: 0 + }, + + accel: { + x: 0, + y: 0 + }, + + vel: { + x: 0, + y: 0 + }, + + aRad: 200, + + safety: 0.25, + + resize: function(){ + this.home.x = this.pos.x = this.ref.x * this.shapeSize.x; + this.home.y = this.pos.y = this.ref.y * this.shapeSize.y; + + return this; + }, + + update: function(engine){ + var target = Vector.coerce(engine.mouse), + distanceToMouse, toHome, mag, safety; + + target.x += (this.shapeSize.x - engine.width) / 2; + target.y += (this.shapeSize.y - engine.height) / 2; + + distanceToMouse = this.distanceTo(target); + + this.accel.mult(0); + + if (distanceToMouse < this.aRad) { + this._chasing = true; + this.toChase(target); + this.fillStyle = this.chasingFillstyle; + } else { + this._chasing = false; + this.fillStyle = this.defaultFillstyle; + } + + this.toChase(this.home, this.maxForce / 2); + + this.vel.add(this.accel); + this.pos.add( + Vector.mult(this.vel, engine.tick) + ); + + toHome = Vector.sub(this.home, this.pos); + mag = toHome.mag(); + safety = this.aRad * (this.safety * 3); + if (mag > this.aRad - safety) { + toHome.normalize(); + toHome.mult(this.aRad - safety); + this.pos = Vector.sub(this.home, toHome); + } + + target = null; + toHome = null; + return this; + }, + + toChase: function(target, maxForce){ + var desired, steer, distance, mult, safety; + + maxForce = maxForce || this.maxForce; + + target = Vector.coerce(target); + desired = Vector.sub(target, this.pos); + distance = desired.mag(); + desired.normalize(); + + safety = this.aRad * this.safety; + + if (distance < safety) { + mult = Engine.map(distance, 0, safety, 0, this.maxSpeed); + } else if (distance > this.aRad - safety){ + mult = Engine.map(this.aRad - distance, 0, safety, 0, this.maxSpeed); + } else { + mult = this.maxSpeed; + } + + desired.mult(mult); + + steer = Vector.sub(desired, this.vel); + steer.limit(maxForce); + this.accel.add(steer); + + target = null; + desired = null; + steer = null; + }, + + draw: function(ctx, scale){ + ctx.fillStyle = this.fillStyle; + ctx.fillRect( + (this.pos.x - this.radius / 2) * scale >> 0, + (this.pos.y - this.radius / 2) * scale >> 0, + this.radius * scale, + this.radius * scale + ); + + return this; + }, + + distanceTo: function(target) { + var xd = this.home.x - target.x; + var yd = this.home.y - target.y; + return Math.sqrt(xd * xd + yd * yd ); + } +}; + +})( + window.Engine, + window.Vector +); diff --git a/website/source/javascripts/app/Engine.Point.js b/website/source/javascripts/app/Engine.Point.js new file mode 100644 index 0000000000..4d53eb2650 --- /dev/null +++ b/website/source/javascripts/app/Engine.Point.js @@ -0,0 +1,118 @@ +(function( + Engine, + Vector +){ 'use strict'; + +Engine.Point = function(id, x, y, shapeSize){ + this.id = id; + + this.shapeSize = shapeSize; + this.ref = new Vector(x, y); + + this.pos = new Vector( + x * shapeSize.x, + y * shapeSize.y + ); + + this.target = this.pos.clone(); + this.pos.x = shapeSize.x / 2; + this.pos.y = shapeSize.y / 2; + this.accel = Vector.coerce(this.accel); + this.vel = Vector.coerce(this.vel); + + this.stiffness = Engine.getRandomFloat(150, 600); + this.friction = Engine.getRandomFloat(12, 18); +}; + +Engine.Point.prototype = { + + radius: 1, + + stiffness : 200, + friction : 13, + threshold : 0.03, + + pos: { + x: 0, + y: 0 + }, + + accel: { + x: 0, + y: 0 + }, + + vel : { + x: 0, + y: 0 + }, + + target: { + x: 0, + y: 0 + }, + + resize: function(){ + this.target.x = this.pos.x = this.ref.x * this.shapeSize.x; + this.target.y = this.pos.y = this.ref.y * this.shapeSize.y; + }, + + updateBreathingPhysics: function(){ + this.stiffness = Engine.getRandomFloat(2, 4); + this.friction = Engine.getRandomFloat(1, 2); + }, + + updateTarget: function(newSize){ + var diff; + + this.target.x = this.ref.x * newSize.x; + this.target.y = this.ref.y * newSize.y; + + diff = Vector.sub(newSize, this.shapeSize).div(2); + + this.target.sub(diff); + + this.target.add({ + x: Engine.getRandomFloat(-3, 3), + y: Engine.getRandomFloat(-3, 3) + }); + }, + + update: function(engine){ + var newAccel; + + newAccel = Vector.sub(this.target, this.pos) + .mult(this.stiffness) + .sub(Vector.mult(this.vel, this.friction)); + + this.accel.set(newAccel); + + this.vel.add(Vector.mult(this.accel, engine.tick)); + + this.pos.add( + Vector.mult(this.vel, engine.tick) + ); + + newAccel = null; + + return this; + }, + + draw: function(ctx, scale){ + ctx.beginPath(); + ctx.arc( + this.pos.x * scale, + this.pos.y * scale, + this.radius * scale, + 0, + Math.PI * 2, + false + ); + ctx.fillStyle = '#ffffff'; + ctx.fill(); + return this; + } + +}; + +})(window.Engine, window.Vector); diff --git a/website/source/javascripts/app/Engine.Polygon.Puller.js b/website/source/javascripts/app/Engine.Polygon.Puller.js new file mode 100644 index 0000000000..3ad4227b72 --- /dev/null +++ b/website/source/javascripts/app/Engine.Polygon.Puller.js @@ -0,0 +1,29 @@ +(function( + Engine, + Vector +){ + +Engine.Polygon.Puller = function(a, b, c, color, simple){ + this.a = a; + this.b = b; + this.c = c; + + this.strokeStyle = '#ffffff'; +}; + +Engine.Polygon.Puller.prototype = { + + checkChasing: function(){ + if ( + this.a._chasing === true && + this.b._chasing === true && + this.c._chasing === true + ) { + return true; + } + return false; + } + +}; + +})(window.Engine, window.Vector); diff --git a/website/source/javascripts/app/Engine.Polygon.js b/website/source/javascripts/app/Engine.Polygon.js new file mode 100644 index 0000000000..74e80a96d1 --- /dev/null +++ b/website/source/javascripts/app/Engine.Polygon.js @@ -0,0 +1,80 @@ +(function( + Engine, + Vector +){ + +Engine.Polygon = function(a, b, c, color, strokeColor){ + this.a = a; + this.b = b; + this.c = c; + + this.color = Engine.clone(color); + this.strokeColor = strokeColor ? Engine.clone(strokeColor) : Engine.clone(color); + + if (strokeColor) { + this.strokeColor = Engine.clone(strokeColor); + } else { + this.strokeColor = Engine.clone(color); + } + + this.strokeWidth = 0.25; + this.maxStrokeS = this.strokeColor.s; + this.maxStrokeL = this.strokeColor.l; + this.maxColorL = this.color.l; + + this.strokeColor.s = 0; + this.strokeColor.l = 100; + this.color.l = 0; + + this.fillStyle = this.hslaTemplate.substitute(this.color); + this.strokeStyle = this.hslaTemplate.substitute(this.strokeColor); +}; + +Engine.Polygon.prototype = { + + rgbaTemplate: 'rgba({r},{g},{b},{a})', + hslaTemplate: 'hsla({h},{s}%,{l}%,{a})', + + hueShiftSpeed: 20, + duration: 2, + delay: 0, + start: 0, + + // Determine color fill? + update: function(engine){ + var delta; + + if (this.simple) { + return; + } + + this.start += engine.tick; + + delta = this.start; + + if ( + delta > this.delay && + delta < this.delay + this.duration + 1 && + this.color.l < this.maxColorL + ) { + this.color.l = this.maxColorL * (delta - this.delay) / this.duration; + + this.strokeColor.s = this.maxStrokeS * (delta - this.delay) / this.duration; + this.strokeColor.l = (this.maxStrokeL - 100) * (delta - this.delay) / this.duration + 100; + + this.strokeWidth = 1.5 * (delta - this.delay) / this.duration + 0.25; + + if (this.color.l > this.maxColorL) { + this.color.l = this.maxColorL; + this.strokeColor.l = this.maxStrokeL; + this.strokeWidth = 1.5; + } + + this.strokeStyle = this.hslaTemplate.substitute(this.strokeColor); + this.fillStyle = this.hslaTemplate.substitute(this.color); + } + } + +}; + +})(window.Engine, window.Vector); diff --git a/website/source/javascripts/app/Engine.Shape.Puller.js b/website/source/javascripts/app/Engine.Shape.Puller.js new file mode 100644 index 0000000000..0e1c571890 --- /dev/null +++ b/website/source/javascripts/app/Engine.Shape.Puller.js @@ -0,0 +1,179 @@ +(function( + Engine, + Point, + Polygon, + Vector +){ + +Engine.Shape.Puller = function(width, height, json){ + var i, ref, point, poly; + + this.pos = new Vector(0, 0); + this.size = new Vector(width, height); + this.heightRatio = json.data.width / json.data.height; + this.widthRatio = json.data.ar; + + this.resize(width, height, true); + + ref = {}; + this.points = []; + this.polygons = []; + + for (i = 0; i < json.points.length; i++) { + point = new Point( + json.points[i].id, + json.points[i].x, + json.points[i].y, + this.size + ); + ref[point.id] = point; + this.points.push(point); + } + + for (i = 0; i < json.polygons.length; i++) { + poly = json.polygons[i]; + this.polygons.push(new Polygon( + ref[poly.points[0]], + ref[poly.points[1]], + ref[poly.points[2]], + poly.color + )); + this.polygons[this.polygons.length - 1].noFill = true; + } + + this.ref = undefined; +}; + +Engine.Shape.Puller.prototype = { + + alpha: 0, + + sizeOffset: 100, + + resize: function(width, height, sizeOnly){ + var len, p, newWidth, newHeight; + + newHeight = height + this.sizeOffset; + newWidth = this.size.y * this.heightRatio; + + if (newWidth < width) { + newWidth = width + this.sizeOffset; + newHeight = newWidth * this.widthRatio; + } + + this.size.y = newHeight; + this.size.x = newWidth; + + this.pos.x = -(newWidth / 2); + this.pos.y = -(newHeight / 2); + + if (sizeOnly) { + return this; + } + + for (p = 0, len = this.points.length; p < len; p++) { + this.points[p].resize(); + } + }, + + update: function(engine){ + var p; + + for (p = 0; p < this.points.length; p++) { + this.points[p].update(engine); + } + + if (this.alpha < 1) { + this.alpha = Math.min(this.alpha + 2 * engine.tick, 1); + } + + return this; + }, + + draw: function(ctx, scale, engine){ + var p, poly; + + ctx.translate( + this.pos.x * scale >> 0, + this.pos.y * scale >> 0 + ); + + if (this.alpha < 1) { + ctx.globalAlpha = this.alpha; + } + + ctx.beginPath(); + for (p = 0; p < this.polygons.length; p++) { + poly = this.polygons[p]; + ctx.moveTo( + poly.a.pos.x * scale >> 0, + poly.a.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.b.pos.x * scale >> 0, + poly.b.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.c.pos.x * scale >> 0, + poly.c.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.a.pos.x * scale >> 0, + poly.a.pos.y * scale >> 0 + ); + } + ctx.closePath(); + ctx.lineWidth = 0.4 * scale; + ctx.strokeStyle = 'rgba(108,0,243,0.3)'; + ctx.stroke(); + + if (this.alpha < 1) { + ctx.globalAlpha = 1; + } + + for (p = 0; p < this.points.length; p++) { + this.points[p].draw(ctx, scale); + } + + ctx.beginPath(); + for (p = 0; p < this.polygons.length; p++) { + if (this.polygons[p].checkChasing()) { + poly = this.polygons[p]; + ctx.moveTo( + poly.a.pos.x * scale >> 0, + poly.a.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.b.pos.x * scale >> 0, + poly.b.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.c.pos.x * scale >> 0, + poly.c.pos.y * scale >> 0 + ); + ctx.lineTo( + poly.a.pos.x * scale >> 0, + poly.a.pos.y * scale >> 0 + ); + } + } + ctx.closePath(); + ctx.fillStyle = 'rgba(108,0,243,0.1)'; + ctx.fill(); + + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.translate( + engine.width / 2 * engine.scale >> 0, + engine.height / 2 * engine.scale >> 0 + ); + return this; + } + +}; + +})( + window.Engine, + window.Engine.Point.Puller, + window.Engine.Polygon.Puller, + window.Vector +); diff --git a/website/source/javascripts/app/Engine.Shape.js b/website/source/javascripts/app/Engine.Shape.js new file mode 100644 index 0000000000..88da068ff4 --- /dev/null +++ b/website/source/javascripts/app/Engine.Shape.js @@ -0,0 +1,157 @@ +(function( + Engine, + Point, + Polygon, + Vector +){ + +Engine.Shape = function(x, y, width, height, points, polygons){ + var i, ref, point, poly; + + this.pos = new Vector(x, y); + this.size = new Vector(width, height); + this.sizeRef = this.size.clone(); + + ref = {}; + this.points = []; + this.polygons = []; + + for (i = 0; i < points.length; i++) { + point = new Point( + points[i].id, + points[i].x, + points[i].y, + this.size + ); + ref[point.id] = point; + this.points.push(point); + } + + for (i = 0; i < polygons.length; i++) { + poly = polygons[i]; + this.polygons.push(new Polygon( + ref[poly.points[0]], + ref[poly.points[1]], + ref[poly.points[2]], + poly.color, + poly.stroke + )); + } +}; + +Engine.Shape.prototype = { + + breathing: false, + + breath: 0, + breathLength: 1, + breatheIn: false, + + resize: function(newSize, offset){ + var len, p; + + this.size.x = newSize; + this.size.y = newSize; + + this.pos.x = -(newSize / 2); + this.pos.y = -(newSize / 2 + offset); + + for (p = 0, len = this.points.length; p < len; p++) { + this.points[p].resize(); + } + }, + + startBreathing: function(){ + var p; + + this.breathing = true; + this.breath = this.breathLength; + + for (p = 0; p < this.points.length; p++) { + this.points[p].updateBreathingPhysics(); + } + }, + + breathe: function(tick){ + var p, scale, newSize; + + this.breath += tick; + + if (this.breath < this.breathLength) { + return; + } + + scale = 1; + + newSize = Vector.mult(this.sizeRef, scale); + + for (p = 0; p < this.points.length; p++) { + this.points[p].updateTarget(newSize); + } + + this.breath = 0; + }, + + update: function(engine){ + var p; + + if (this.breathing === true) { + this.breathe(engine.tick); + } + + for (p = 0; p < this.points.length; p++) { + this.points[p].update(engine); + } + + for (p = 0; p < this.polygons.length; p++) { + this.polygons[p].update(engine); + } + + return this; + }, + + draw: function(ctx, scale, engine){ + var p, poly; + + ctx.translate( + this.pos.x * scale >> 0, + this.pos.y * scale >> 0 + ); + for (p = 0; p < this.polygons.length; p++) { + poly = this.polygons[p]; + ctx.beginPath(); + ctx.moveTo( + poly.a.pos.x * scale, + poly.a.pos.y * scale + ); + ctx.lineTo( + poly.b.pos.x * scale, + poly.b.pos.y * scale + ); + ctx.lineTo( + poly.c.pos.x * scale, + poly.c.pos.y * scale + ); + ctx.closePath(); + ctx.fillStyle = poly.fillStyle; + ctx.fill(); + ctx.lineWidth = poly.strokeWidth * scale; + ctx.strokeStyle = poly.strokeStyle; + ctx.stroke(); + } + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.translate( + engine.width / 2 * engine.scale >> 0, + engine.height / 2 * engine.scale >> 0 + ); + return this; + } + +}; + +})( + window.Engine, + window.Engine.Point, + window.Engine.Polygon, + window.Vector +); diff --git a/website/source/javascripts/app/Engine.Typewriter.js b/website/source/javascripts/app/Engine.Typewriter.js new file mode 100644 index 0000000000..9629a822ab --- /dev/null +++ b/website/source/javascripts/app/Engine.Typewriter.js @@ -0,0 +1,70 @@ +/* jshint unused:false */ +/* global console */ +(function(Engine){ 'use strict'; + +Engine.Typewriter = function(element){ + this.element = element; + this.content = this.element.textContent.split(''); + this.element.innerHTML = ''; +}; + +Engine.Typewriter.prototype = { + + running: false, + + letterInterval : 0.02, + spaceInterval : 0.4, + + charCount: -1, + waitSpace: false, + + toDraw: '', + + start: function(){ + if (!this.content.length) { + return this; + } + + this._last = this.letterInterval; + this.running = true; + }, + + update: function(engine){ + var newChar; + + if (!this.running) { + return this; + } + + this._last += engine.tick; + + if (this.waitSpace && this._last < this.spaceInterval) { + return this; + } + + if (!this.waitSpace && this._last < this.letterInterval){ + return this; + } + + this._last = 0; + newChar = this.content.shift(); + this.toDraw += newChar; + + if (newChar === ',') { + this.waitSpace = true; + } else { + this.waitSpace = false; + } + + this.element.innerHTML = this.toDraw + '_'; + + if (!this.content.length) { + this.running = false; + } + + return this; + } + +}; + +})(window.Engine); diff --git a/website/source/javascripts/app/Engine.js b/website/source/javascripts/app/Engine.js new file mode 100644 index 0000000000..8d1e937745 --- /dev/null +++ b/website/source/javascripts/app/Engine.js @@ -0,0 +1,381 @@ +(function( + Base, + Vector, + Logo, + Grid, + Chainable +){ + +var sqrt, pow, Engine; + +if (!window.requestAnimationFrame) { + window.requestAnimationFrame = (function(){ + return window.requestAnimationFrame || + window.webkitRequestAnimationFrame || + window.mozRequestAnimationFrame || + function( callback ){ + window.setTimeout(callback, 1000 / 60); + }; + })(); +} + +sqrt = Math.sqrt; +pow = Math.pow; + +Engine = Base.extend({ + + scale: window.devicePixelRatio || 1, + // scale:1, + + shapes : [], + particles : [], + particlesA : [], + particlesB : [], + + _deferredParticles: [], + + ticks: [], + + starGeneratorRate: 600, + + mouse: { + x: -9999, + y: -9999 + }, + + constructor: function(canvas, background, tagLine){ + this.canvas = canvas; + this.background = background; + this.tagLine = tagLine; + + if (!this.canvas.getContext) { + return null; + } + + this.context = this.canvas.getContext('2d'); + + this.setupEvents(); + this.setupStarfield(); + this.setupTessellation(); + this.setupMisc(); + + this.startEngine(); + }, + + startEngine: function(){ + var parent = this.canvas.parentNode; + + this.background.className += ' show'; + this.canvas.style.opacity = 1; + + new Chainable() + .wait(1000) + .then(function(){ + this.starGeneratorRate = 200; + }, this) + .wait(500) + .then(function(){ + parent.className += ' state-one'; + }) + .wait(150) + .then(function(){ + parent.className += ' state-two'; + }) + .wait(150) + .then(function(){ + parent.className += ' state-three'; + }) + .wait(500) + .then(function(){ + parent.className += ' state-four'; + }) + .wait(100) + .then(function(){ + this.showShapes = true; + }, this) + .wait(800) + .then(function(){ + this.logo.startBreathing(); + }, this) + .wait(200) + .then(function(){ + this.showGrid = true; + }, this) + .wait(1000) + .then(function(){ + this.typewriter.start(); + }, this); + + this.render(); + }, + + + setupMisc: function(){ + this.last = Date.now() / 1000; + this.render = this.render.bind(this); + + this.typewriter = new Engine.Typewriter(this.tagLine); + }, + + setupEvents: function(){ + this.resize = this.resize.bind(this); + this.resize(); + window.addEventListener('resize', this.resize, false); + + this._handleScroll = this._handleScroll.bind(this); + this._handleScroll(); + window.addEventListener('scroll', this._handleScroll, false); + + this._handleMouseCoords = this._handleMouseCoords.bind(this); + window.addEventListener('mousemove', this._handleMouseCoords, false); + }, + + setupStarfield: function(){ + this.particles = []; + // this.generateParticles(50, true); + this.generateParticles(400); + }, + + setupTessellation: function(canvas){ + var size, offset; + this.shapes = []; + if (window.innerWidth < 570) { + size = 300; + offset = 0; + } else { + size = 360; + offset = 40; + } + + this.logo = new Engine.Shape( + -(size / 2), + -(size / 2 + offset), + size, + size, + Logo.points, + Logo.polygons + ); + + this.grid = new Engine.Shape.Puller(this.width, this.height, Grid); + }, + + + getAverageTickTime: function(){ + var sum = 0, s; + + for (s = 0; s < this.ticks.length; s++) { + sum += this.ticks[s]; + } + + window.console.log('Average Tick Time:', sum / this.ticks.length); + }, + + getLongestTick: function(){ + var max = 0, index, s; + + for (s = 0; s < this.ticks.length; s++) { + if (this.ticks[s] > max) { + max = this.ticks[s]; + index = s; + } + } + + window.console.log('Max tick was:', max, 'at index:', index); + }, + + render: function(){ + var scale = this.scale, p, particle, index; + + if (this.paused) { + return; + } + + if (this.scrollY > this.height) { + window.requestAnimationFrame(this.render); + return; + } + + this.context.clearRect( + -(this.width / 2) * scale, + -(this.height / 2) * scale, + this.width * scale, + this.height * scale + ); + + this.now = Date.now() / 1000; + this.tick = Math.min(this.now - this.last, 0.017); + + // Update all particles... may need to be optimized + for (p = 0; p < this.particles.length; p++) { + this.particles[p].update(this); + } + + // Batch render particles based on color + // to prevent unneeded context state change + this.context.fillStyle = '#8750c2'; + for (p = 0; p < this.particlesA.length; p++) { + particle = this.particlesA[p]; + + if (particle.radius < 0.25) { + continue; + } + this.context.fillRect( + particle.pos.x * scale >> 0, + particle.pos.y * scale >> 0, + particle.radius * scale, + particle.radius * scale + ); + } + + this.context.fillStyle = '#b976ff'; + for (p = 0; p < this.particlesB.length; p++) { + particle = this.particlesB[p]; + + if (particle.radius < 0.25) { + continue; + } + this.context.fillRect( + particle.pos.x * scale >> 0, + particle.pos.y * scale >> 0, + particle.radius * scale, + particle.radius * scale + ); + } + + this.particlesA.length = 0; + this.particlesB.length = 0; + + // Remove destroyed particles + for (p = 0; p < this._deferredParticles.length; p++) { + index = this.particles.indexOf(this._deferredParticles.pop()); + if (index >= 0) { + this.particles.splice(index, 1); + } + } + + if (this.showGrid) { + this.grid + .update(this) + .draw(this.context, scale, this); + } + + if (this.showShapes) { + this.logo + .update(this) + .draw(this.context, scale, this); + } + + this.typewriter.update(this); + + this.last = this.now; + + this.generateParticles(this.starGeneratorRate * this.tick >> 0); + + window.requestAnimationFrame(this.render); + }, + + generateParticles: function(num, fixed){ + var p; + + for (p = 0; p < num; p++) { + if (fixed) { + this.particles.push(new Engine.Particle.Fixed(this.width, this.height)); + } else { + this.particles.push(new Engine.Particle(this.width, this.height)); + } + } + }, + + resize: function(){ + var scale = this.scale, + size, offset; + + if (window.innerWidth < 570) { + this.height = 560; + } else { + this.height = 700; + } + + this.width = window.innerWidth; + + this.canvas.width = this.width * scale; + this.canvas.height = this.height * scale; + + this.context.translate( + this.width / 2 * scale >> 0, + this.height / 2 * scale >> 0 + ); + this.context.lineJoin = 'bevel'; + + if (this.grid) { + this.grid.resize(this.width, this.height); + } + + if (this.logo) { + if (this.height === 560) { + size = 300; + offset = 0; + } else { + size = 360; + offset = 40; + } + this.logo.resize(size, offset); + } + }, + + _handleMouseCoords: function(event){ + this.mouse.x = event.pageX; + this.mouse.y = event.pageY; + }, + + _handleScroll: function(){ + this.scrollY = window.scrollY; + }, + + pause: function(){ + this.paused = true; + }, + + resume: function(){ + if (!this.paused) { + return; + } + this.paused = false; + this.render(); + }, + + getSnapshot: function(){ + window.open(this.canvas.toDataURL('image/png')); + } + +}); + +Engine.map = function(val, istart, istop, ostart, ostop) { + return ostart + (ostop - ostart) * ((val - istart) / (istop - istart)); +}; + +Engine.getRandomFloat = function(min, max) { + return Math.random() * (max - min) + min; +}; + +Engine.getRandomInt = function(min, max) { + return Math.floor(Math.random() * (max - min + 1) + min); +}; + +Engine.clone = function(ref) { + var clone = {}, key; + for (key in ref) { + clone[key] = ref[key]; + } + return clone; +}; + +window.Engine = Engine; + +})( + window.Base, + window.Vector, + window.Logo, + window.Grid, + window.Chainable +); diff --git a/website/source/javascripts/app/Grid.js b/website/source/javascripts/app/Grid.js new file mode 100644 index 0000000000..9ea5055ec5 --- /dev/null +++ b/website/source/javascripts/app/Grid.js @@ -0,0 +1,2384 @@ +var Grid = { + "data": { + "width": 1572, + "height": 979, + "ar": 0.6227735368956743 + }, + "points": [ + { + "id": "point-0", + "x": 0.01743002544529262, + "y": 0.045658835546476005 + }, + { + "id": "point-1", + "x": -0.0001272264631043257, + "y": 0.7701736465781408 + }, + { + "id": "point-2", + "x": 0.012468193384223917, + "y": 0.32665985699693567 + }, + { + "id": "point-7", + "x": 0.04052162849872774, + "y": 0.12277834525025537 + }, + { + "id": "point-12", + "x": 0.13568702290076337, + "y": 0.030847803881511746 + }, + { + "id": "point-17", + "x": 0.14465648854961832, + "y": 0.16772216547497446 + }, + { + "id": "point-22", + "x": 0.20184478371501274, + "y": 0.05536261491317671 + }, + { + "id": "point-27", + "x": 0.37099236641221384, + "y": 0.02696629213483146 + }, + { + "id": "point-32", + "x": 0.49357506361323156, + "y": 0.00020429009193054137 + }, + { + "id": "point-37", + "x": 0.1993002544529262, + "y": 0.16281920326864147 + }, + { + "id": "point-42", + "x": 0.30337150127226464, + "y": 0.05965270684371808 + }, + { + "id": "point-52", + "x": 0.32461832061068707, + "y": 0.1689479060265577 + }, + { + "id": "point-62", + "x": 0.4028625954198473, + "y": 0.12502553626149132 + }, + { + "id": "point-72", + "x": 0.5604325699745547, + "y": 0.13003064351378957 + }, + { + "id": "point-77", + "x": 0.5724554707379135, + "y": 0.01491317671092952 + }, + { + "id": "point-82", + "x": 0.8836513994910941, + "y": 0.05372829417773237 + }, + { + "id": "point-87", + "x": 0.9759541984732825, + "y": 0.061184882533197135 + }, + { + "id": "point-92", + "x": 0.7122137404580152, + "y": 0.07405515832482125 + }, + { + "id": "point-102", + "x": 0.6561704834605598, + "y": 0.218488253319714 + }, + { + "id": "point-107", + "x": 0.7784351145038169, + "y": 0.1319713993871297 + }, + { + "id": "point-112", + "x": 0.7912213740458014, + "y": 0.08672114402451482 + }, + { + "id": "point-122", + "x": 0.8616412213740458, + "y": 0.12941777323799797 + }, + { + "id": "point-132", + "x": 0.9780534351145039, + "y": 0.17242083758937693 + }, + { + "id": "point-142", + "x": 0.9898854961832061, + "y": 0.30960163432073545 + }, + { + "id": "point-152", + "x": 0.12888040712468193, + "y": 0.36149131767109294 + }, + { + "id": "point-162", + "x": 0.21743002544529266, + "y": 0.39662921348314606 + }, + { + "id": "point-167", + "x": 0.3361959287531807, + "y": 0.2868232890704801 + }, + { + "id": "point-182", + "x": 0.37220101781170484, + "y": 0.3344228804902961 + }, + { + "id": "point-187", + "x": 0.4620865139949109, + "y": 0.32533197139938713 + }, + { + "id": "point-192", + "x": 0.5159033078880407, + "y": 0.24106230847803883 + }, + { + "id": "point-202", + "x": 0.5856234096692112, + "y": 0.3547497446373851 + }, + { + "id": "point-217", + "x": 0.7061704834605598, + "y": 0.30643513789581206 + }, + { + "id": "point-227", + "x": 0.7717557251908397, + "y": 0.35556690500510724 + }, + { + "id": "point-232", + "x": 0.8581424936386769, + "y": 0.2822267620020429 + }, + { + "id": "point-252", + "x": 0.009287531806615776, + "y": 0.47477017364657814 + }, + { + "id": "point-257", + "x": 0.10756997455470736, + "y": 0.4454545454545455 + }, + { + "id": "point-267", + "x": 0.17767175572519084, + "y": 0.5234933605720122 + }, + { + "id": "point-277", + "x": 0.2962468193384224, + "y": 0.5465781409601634 + }, + { + "id": "point-292", + "x": 0.4138676844783716, + "y": 0.4349336057201226 + }, + { + "id": "point-302", + "x": 0.5194020356234097, + "y": 0.5248212461695607 + }, + { + "id": "point-307", + "x": 0.5548982188295165, + "y": 0.49836567926455566 + }, + { + "id": "point-317", + "x": 0.6503816793893129, + "y": 0.5194075587334014 + }, + { + "id": "point-327", + "x": 0.7473282442748093, + "y": 0.4626149131767109 + }, + { + "id": "point-337", + "x": 0.8691475826972009, + "y": 0.49458631256384067 + }, + { + "id": "point-352", + "x": 0.9832061068702289, + "y": 0.4917262512768131 + }, + { + "id": "point-357", + "x": 0.9990458015267175, + "y": 0.7504596527068438 + }, + { + "id": "point-362", + "x": 0.05012722646310432, + "y": 0.6356486210418795 + }, + { + "id": "point-372", + "x": 0.14440203562340967, + "y": 0.6027579162410623 + }, + { + "id": "point-382", + "x": 0.17550890585241732, + "y": 0.6821246169560776 + }, + { + "id": "point-392", + "x": 0.3370229007633587, + "y": 0.6620020429009194 + }, + { + "id": "point-397", + "x": 0.38403307888040716, + "y": 0.6074565883554648 + }, + { + "id": "point-407", + "x": 0.49141221374045796, + "y": 0.609090909090909 + }, + { + "id": "point-417", + "x": 0.6092239185750636, + "y": 0.6490296220633298 + }, + { + "id": "point-432", + "x": 0.6994910941475826, + "y": 0.6377936670071501 + }, + { + "id": "point-442", + "x": 0.8021628498727735, + "y": 0.6412665985699693 + }, + { + "id": "point-452", + "x": 0.8450381679389314, + "y": 0.6878447395301328 + }, + { + "id": "point-457", + "x": 0.9385496183206108, + "y": 0.5991828396322778 + }, + { + "id": "point-472", + "x": 0.08269720101781171, + "y": 0.8129724208375894 + }, + { + "id": "point-487", + "x": 0.19293893129770992, + "y": 0.7488253319713994 + }, + { + "id": "point-497", + "x": 0.3399491094147582, + "y": 0.7432073544433095 + }, + { + "id": "point-507", + "x": 0.4349872773536895, + "y": 0.8191011235955056 + }, + { + "id": "point-517", + "x": 0.4825699745547074, + "y": 0.8216547497446374 + }, + { + "id": "point-527", + "x": 0.6143129770992367, + "y": 0.8338100102145046 + }, + { + "id": "point-532", + "x": 0.6626590330788804, + "y": 0.7674157303370785 + }, + { + "id": "point-542", + "x": 0.80470737913486, + "y": 0.7797752808988764 + }, + { + "id": "point-557", + "x": 0.858587786259542, + "y": 0.780388151174668 + }, + { + "id": "point-571", + "x": 0.04058524173027989, + "y": 0.9923391215526047 + }, + { + "id": "point-577", + "x": 0.10038167938931299, + "y": 0.9534218590398367 + }, + { + "id": "point-587", + "x": 0.21615776081424937, + "y": 0.9832482124616956 + }, + { + "id": "point-592", + "x": 0.31653944020356234, + "y": 0.8937691521961184 + }, + { + "id": "point-602", + "x": 0.3648218829516539, + "y": 0.9393258426966292 + }, + { + "id": "point-612", + "x": 0.4798346055979643, + "y": 0.9085801838610827 + }, + { + "id": "point-627", + "x": 0.6159669211195928, + "y": 0.9221654749744637 + }, + { + "id": "point-632", + "x": 0.7001272264631042, + "y": 0.9664964249233913 + }, + { + "id": "point-647", + "x": 0.7608778625954199, + "y": 0.9989785495403473 + }, + { + "id": "point-652", + "x": 0.8911577608142494, + "y": 0.9557711950970379 + }, + { + "id": "point-667", + "x": 0.9989821882951655, + "y": 0.9853932584269665 + } + ], + "polygons": [ + { + "id": "poly-0", + "color": { + "h": 269.25373134328356, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-0", + "point-1", + "point-2" + ] + }, + { + "id": "poly-1", + "color": { + "h": 277.1428571428571, + "s": 100, + "l": 67.05882352941177, + "a": 1 + }, + "points": [ + "point-0", + "point-2", + "point-7" + ] + }, + { + "id": "poly-2", + "color": { + "h": 277.1428571428571, + "s": 100, + "l": 67.05882352941177, + "a": 1 + }, + "points": [ + "point-0", + "point-7", + "point-12" + ] + }, + { + "id": "poly-3", + "color": { + "h": 275.31428571428575, + "s": 100, + "l": 65.68627450980392, + "a": 1 + }, + "points": [ + "point-12", + "point-7", + "point-17" + ] + }, + { + "id": "poly-4", + "color": { + "h": 276.26373626373623, + "s": 100, + "l": 64.31372549019608, + "a": 1 + }, + "points": [ + "point-12", + "point-17", + "point-22" + ] + }, + { + "id": "poly-5", + "color": { + "h": 272.23404255319144, + "s": 100, + "l": 63.13725490196078, + "a": 1 + }, + "points": [ + "point-12", + "point-22", + "point-27" + ] + }, + { + "id": "poly-6", + "color": { + "h": 268.2692307692307, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-12", + "point-27", + "point-32" + ] + }, + { + "id": "poly-7", + "color": { + "h": 274.46808510638294, + "s": 100, + "l": 63.13725490196078, + "a": 1 + }, + "points": [ + "point-22", + "point-17", + "point-37" + ] + }, + { + "id": "poly-8", + "color": { + "h": 272.23404255319144, + "s": 100, + "l": 63.13725490196078, + "a": 1 + }, + "points": [ + "point-22", + "point-37", + "point-42" + ] + }, + { + "id": "poly-9", + "color": { + "h": 269.25373134328356, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-22", + "point-42", + "point-27" + ] + }, + { + "id": "poly-10", + "color": { + "h": 269.25373134328356, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-42", + "point-37", + "point-52" + ] + }, + { + "id": "poly-11", + "color": { + "h": 268.2692307692307, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-42", + "point-52", + "point-27" + ] + }, + { + "id": "poly-12", + "color": { + "h": 265.96153846153845, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-27", + "point-52", + "point-62" + ] + }, + { + "id": "poly-13", + "color": { + "h": 265.88235294117646, + "s": 86.4406779661017, + "l": 53.72549019607843, + "a": 1 + }, + "points": [ + "point-27", + "point-62", + "point-32" + ] + }, + { + "id": "poly-14", + "color": { + "h": 265.48387096774195, + "s": 76.22950819672131, + "l": 47.84313725490196, + "a": 1 + }, + "points": [ + "point-32", + "point-62", + "point-72" + ] + }, + { + "id": "poly-15", + "color": { + "h": 265.1933701657459, + "s": 83.41013824884793, + "l": 42.549019607843135, + "a": 1 + }, + "points": [ + "point-32", + "point-72", + "point-77" + ] + }, + { + "id": "poly-16", + "color": { + "h": 264.45859872611464, + "s": 96.31901840490798, + "l": 31.960784313725487, + "a": 1 + }, + "points": [ + "point-32", + "point-77", + "point-82" + ] + }, + { + "id": "poly-17", + "color": { + "h": 261.69230769230774, + "s": 100, + "l": 25.49019607843137, + "a": 1 + }, + "points": [ + "point-32", + "point-82", + "point-87" + ] + }, + { + "id": "poly-18", + "color": { + "h": 263.3532934131737, + "s": 91.2568306010929, + "l": 35.88235294117647, + "a": 1 + }, + "points": [ + "point-77", + "point-72", + "point-92" + ] + }, + { + "id": "poly-19", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-77", + "point-92", + "point-82" + ] + }, + { + "id": "poly-20", + "color": { + "h": 264.45859872611464, + "s": 96.31901840490798, + "l": 31.960784313725487, + "a": 1 + }, + "points": [ + "point-92", + "point-72", + "point-102" + ] + }, + { + "id": "poly-21", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-92", + "point-102", + "point-107" + ] + }, + { + "id": "poly-22", + "color": { + "h": 261.69230769230774, + "s": 100, + "l": 25.49019607843137, + "a": 1 + }, + "points": [ + "point-92", + "point-107", + "point-112" + ] + }, + { + "id": "poly-23", + "color": { + "h": 260, + "s": 100, + "l": 24.11764705882353, + "a": 1 + }, + "points": [ + "point-92", + "point-112", + "point-82" + ] + }, + { + "id": "poly-24", + "color": { + "h": 260, + "s": 100, + "l": 24.11764705882353, + "a": 1 + }, + "points": [ + "point-112", + "point-107", + "point-122" + ] + }, + { + "id": "poly-25", + "color": { + "h": 260, + "s": 100, + "l": 24.11764705882353, + "a": 1 + }, + "points": [ + "point-112", + "point-122", + "point-82" + ] + }, + { + "id": "poly-26", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-82", + "point-122", + "point-132" + ] + }, + { + "id": "poly-27", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-82", + "point-132", + "point-87" + ] + }, + { + "id": "poly-28", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-87", + "point-132", + "point-142" + ] + }, + { + "id": "poly-29", + "color": { + "h": 275.31428571428575, + "s": 100, + "l": 65.68627450980392, + "a": 1 + }, + "points": [ + "point-7", + "point-2", + "point-17" + ] + }, + { + "id": "poly-30", + "color": { + "h": 274.46808510638294, + "s": 100, + "l": 63.13725490196078, + "a": 1 + }, + "points": [ + "point-17", + "point-2", + "point-152" + ] + }, + { + "id": "poly-31", + "color": { + "h": 272.23404255319144, + "s": 100, + "l": 63.13725490196078, + "a": 1 + }, + "points": [ + "point-17", + "point-152", + "point-37" + ] + }, + { + "id": "poly-32", + "color": { + "h": 269.25373134328356, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-37", + "point-152", + "point-162" + ] + }, + { + "id": "poly-33", + "color": { + "h": 268.2692307692307, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-37", + "point-162", + "point-167" + ] + }, + { + "id": "poly-34", + "color": { + "h": 268.2692307692307, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-37", + "point-167", + "point-52" + ] + }, + { + "id": "poly-35", + "color": { + "h": 265.92233009708735, + "s": 92.7927927927928, + "l": 56.470588235294116, + "a": 1 + }, + "points": [ + "point-52", + "point-167", + "point-62" + ] + }, + { + "id": "poly-36", + "color": { + "h": 265.88235294117646, + "s": 86.4406779661017, + "l": 53.72549019607843, + "a": 1 + }, + "points": [ + "point-62", + "point-167", + "point-182" + ] + }, + { + "id": "poly-37", + "color": { + "h": 265.48387096774195, + "s": 76.22950819672131, + "l": 47.84313725490196, + "a": 1 + }, + "points": [ + "point-62", + "point-182", + "point-187" + ] + }, + { + "id": "poly-38", + "color": { + "h": 265.24590163934425, + "s": 79.22077922077922, + "l": 45.294117647058826, + "a": 1 + }, + "points": [ + "point-62", + "point-187", + "point-192" + ] + }, + { + "id": "poly-39", + "color": { + "h": 265.24590163934425, + "s": 79.22077922077922, + "l": 45.294117647058826, + "a": 1 + }, + "points": [ + "point-62", + "point-192", + "point-72" + ] + }, + { + "id": "poly-40", + "color": { + "h": 263.3532934131737, + "s": 91.2568306010929, + "l": 35.88235294117647, + "a": 1 + }, + "points": [ + "point-192", + "point-187", + "point-202" + ] + }, + { + "id": "poly-41", + "color": { + "h": 264.45859872611464, + "s": 96.31901840490798, + "l": 31.960784313725487, + "a": 1 + }, + "points": [ + "point-192", + "point-202", + "point-102" + ] + }, + { + "id": "poly-42", + "color": { + "h": 263.3532934131737, + "s": 91.2568306010929, + "l": 35.88235294117647, + "a": 1 + }, + "points": [ + "point-192", + "point-102", + "point-72" + ] + }, + { + "id": "poly-43", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-102", + "point-202", + "point-217" + ] + }, + { + "id": "poly-44", + "color": { + "h": 261.69230769230774, + "s": 100, + "l": 25.49019607843137, + "a": 1 + }, + "points": [ + "point-102", + "point-217", + "point-107" + ] + }, + { + "id": "poly-45", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-107", + "point-217", + "point-227" + ] + }, + { + "id": "poly-46", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-107", + "point-227", + "point-232" + ] + }, + { + "id": "poly-47", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-107", + "point-232", + "point-122" + ] + }, + { + "id": "poly-48", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-122", + "point-232", + "point-132" + ] + }, + { + "id": "poly-49", + "color": { + "h": 255.31914893617022, + "s": 100, + "l": 18.43137254901961, + "a": 1 + }, + "points": [ + "point-132", + "point-232", + "point-142" + ] + }, + { + "id": "poly-50", + "color": { + "h": 265.24590163934425, + "s": 79.22077922077922, + "l": 45.294117647058826, + "a": 1 + }, + "points": [ + "point-2", + "point-1", + "point-252" + ] + }, + { + "id": "poly-51", + "color": { + "h": 265.96153846153845, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-2", + "point-252", + "point-257" + ] + }, + { + "id": "poly-52", + "color": { + "h": 268.2692307692307, + "s": 100, + "l": 59.21568627450981, + "a": 1 + }, + "points": [ + "point-2", + "point-257", + "point-152" + ] + }, + { + "id": "poly-53", + "color": { + "h": 265.54455445544556, + "s": 80.8, + "l": 50.98039215686274, + "a": 1 + }, + "points": [ + "point-152", + "point-257", + "point-267" + ] + }, + { + "id": "poly-54", + "color": { + "h": 265.54455445544556, + "s": 80.8, + "l": 50.98039215686274, + "a": 1 + }, + "points": [ + "point-152", + "point-267", + "point-162" + ] + }, + { + "id": "poly-55", + "color": { + "h": 264.68571428571425, + "s": 91.62303664921467, + "l": 37.450980392156865, + "a": 1 + }, + "points": [ + "point-162", + "point-267", + "point-277" + ] + }, + { + "id": "poly-56", + "color": { + "h": 265.24590163934425, + "s": 79.22077922077922, + "l": 45.294117647058826, + "a": 1 + }, + "points": [ + "point-162", + "point-277", + "point-167" + ] + }, + { + "id": "poly-57", + "color": { + "h": 265.1933701657459, + "s": 83.41013824884793, + "l": 42.549019607843135, + "a": 1 + }, + "points": [ + "point-167", + "point-277", + "point-182" + ] + }, + { + "id": "poly-58", + "color": { + "h": 263.3532934131737, + "s": 91.2568306010929, + "l": 35.88235294117647, + "a": 1 + }, + "points": [ + "point-182", + "point-277", + "point-292" + ] + }, + { + "id": "poly-59", + "color": { + "h": 264.68571428571425, + "s": 91.62303664921467, + "l": 37.450980392156865, + "a": 1 + }, + "points": [ + "point-182", + "point-292", + "point-187" + ] + }, + { + "id": "poly-60", + "color": { + "h": 262.3448275862069, + "s": 100, + "l": 28.431372549019606, + "a": 1 + }, + "points": [ + "point-187", + "point-292", + "point-302" + ] + }, + { + "id": "poly-61", + "color": { + "h": 260, + "s": 100, + "l": 24.11764705882353, + "a": 1 + }, + "points": [ + "point-187", + "point-302", + "point-307" + ] + }, + { + "id": "poly-62", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-187", + "point-307", + "point-202" + ] + }, + { + "id": "poly-63", + "color": { + "h": 255.31914893617022, + "s": 100, + "l": 18.43137254901961, + "a": 1 + }, + "points": [ + "point-202", + "point-307", + "point-317" + ] + }, + { + "id": "poly-64", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-202", + "point-317", + "point-217" + ] + }, + { + "id": "poly-65", + "color": { + "h": 249.75, + "s": 100, + "l": 15.686274509803921, + "a": 1 + }, + "points": [ + "point-217", + "point-317", + "point-327" + ] + }, + { + "id": "poly-66", + "color": { + "h": 249.75, + "s": 100, + "l": 15.686274509803921, + "a": 1 + }, + "points": [ + "point-217", + "point-327", + "point-227" + ] + }, + { + "id": "poly-67", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-227", + "point-327", + "point-337" + ] + }, + { + "id": "poly-68", + "color": { + "h": 246.57534246575347, + "s": 100, + "l": 14.313725490196077, + "a": 1 + }, + "points": [ + "point-227", + "point-337", + "point-232" + ] + }, + { + "id": "poly-69", + "color": { + "h": 242.99999999999997, + "s": 100, + "l": 11.76470588235294, + "a": 1 + }, + "points": [ + "point-232", + "point-337", + "point-142" + ] + }, + { + "id": "poly-70", + "color": { + "h": 240, + "s": 100, + "l": 8.03921568627451, + "a": 1 + }, + "points": [ + "point-142", + "point-337", + "point-352" + ] + }, + { + "id": "poly-71", + "color": { + "h": 240, + "s": 100, + "l": 1.5686274509803921, + "a": 1 + }, + "points": [ + "point-142", + "point-352", + "point-357" + ] + }, + { + "id": "poly-72", + "color": { + "h": 264.45859872611464, + "s": 96.31901840490798, + "l": 31.960784313725487, + "a": 1 + }, + "points": [ + "point-252", + "point-1", + "point-362" + ] + }, + { + "id": "poly-73", + "color": { + "h": 265.24590163934425, + "s": 79.22077922077922, + "l": 45.294117647058826, + "a": 1 + }, + "points": [ + "point-252", + "point-362", + "point-257" + ] + }, + { + "id": "poly-74", + "color": { + "h": 264.68571428571425, + "s": 91.62303664921467, + "l": 37.450980392156865, + "a": 1 + }, + "points": [ + "point-257", + "point-362", + "point-372" + ] + }, + { + "id": "poly-75", + "color": { + "h": 264.9438202247191, + "s": 87.25490196078431, + "l": 40, + "a": 1 + }, + "points": [ + "point-257", + "point-372", + "point-267" + ] + }, + { + "id": "poly-76", + "color": { + "h": 262.3448275862069, + "s": 100, + "l": 28.431372549019606, + "a": 1 + }, + "points": [ + "point-267", + "point-372", + "point-382" + ] + }, + { + "id": "poly-77", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-267", + "point-382", + "point-277" + ] + }, + { + "id": "poly-78", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-277", + "point-382", + "point-392" + ] + }, + { + "id": "poly-79", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-277", + "point-392", + "point-397" + ] + }, + { + "id": "poly-80", + "color": { + "h": 261.69230769230774, + "s": 100, + "l": 25.49019607843137, + "a": 1 + }, + "points": [ + "point-277", + "point-397", + "point-292" + ] + }, + { + "id": "poly-81", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-292", + "point-397", + "point-407" + ] + }, + { + "id": "poly-82", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-292", + "point-407", + "point-302" + ] + }, + { + "id": "poly-83", + "color": { + "h": 240, + "s": 100, + "l": 10.588235294117647, + "a": 1 + }, + "points": [ + "point-302", + "point-407", + "point-417" + ] + }, + { + "id": "poly-84", + "color": { + "h": 242.99999999999997, + "s": 100, + "l": 11.76470588235294, + "a": 1 + }, + "points": [ + "point-302", + "point-417", + "point-307" + ] + }, + { + "id": "poly-85", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-307", + "point-417", + "point-317" + ] + }, + { + "id": "poly-86", + "color": { + "h": 240, + "s": 100, + "l": 4.705882352941177, + "a": 1 + }, + "points": [ + "point-317", + "point-417", + "point-432" + ] + }, + { + "id": "poly-87", + "color": { + "h": 240, + "s": 100, + "l": 6.862745098039216, + "a": 1 + }, + "points": [ + "point-317", + "point-432", + "point-327" + ] + }, + { + "id": "poly-88", + "color": { + "h": 240, + "s": 100, + "l": 1.5686274509803921, + "a": 1 + }, + "points": [ + "point-327", + "point-432", + "point-442" + ] + }, + { + "id": "poly-89", + "color": { + "h": 240, + "s": 100, + "l": 2.549019607843137, + "a": 1 + }, + "points": [ + "point-327", + "point-442", + "point-337" + ] + }, + { + "id": "poly-90", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-337", + "point-442", + "point-452" + ] + }, + { + "id": "poly-91", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-337", + "point-452", + "point-457" + ] + }, + { + "id": "poly-92", + "color": { + "h": 240, + "s": 100, + "l": 1.5686274509803921, + "a": 1 + }, + "points": [ + "point-337", + "point-457", + "point-352" + ] + }, + { + "id": "poly-93", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-352", + "point-457", + "point-357" + ] + }, + { + "id": "poly-94", + "color": { + "h": 261.69230769230774, + "s": 100, + "l": 25.49019607843137, + "a": 1 + }, + "points": [ + "point-362", + "point-1", + "point-472" + ] + }, + { + "id": "poly-95", + "color": { + "h": 260, + "s": 100, + "l": 24.11764705882353, + "a": 1 + }, + "points": [ + "point-362", + "point-472", + "point-382" + ] + }, + { + "id": "poly-96", + "color": { + "h": 263.64963503649636, + "s": 100, + "l": 26.862745098039216, + "a": 1 + }, + "points": [ + "point-362", + "point-382", + "point-372" + ] + }, + { + "id": "poly-97", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-382", + "point-472", + "point-487" + ] + }, + { + "id": "poly-98", + "color": { + "h": 255.31914893617022, + "s": 100, + "l": 18.43137254901961, + "a": 1 + }, + "points": [ + "point-382", + "point-487", + "point-392" + ] + }, + { + "id": "poly-99", + "color": { + "h": 249.75, + "s": 100, + "l": 15.686274509803921, + "a": 1 + }, + "points": [ + "point-392", + "point-487", + "point-497" + ] + }, + { + "id": "poly-100", + "color": { + "h": 246.57534246575347, + "s": 100, + "l": 14.313725490196077, + "a": 1 + }, + "points": [ + "point-392", + "point-497", + "point-397" + ] + }, + { + "id": "poly-101", + "color": { + "h": 240, + "s": 100, + "l": 10.588235294117647, + "a": 1 + }, + "points": [ + "point-397", + "point-497", + "point-507" + ] + }, + { + "id": "poly-102", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-397", + "point-507", + "point-407" + ] + }, + { + "id": "poly-103", + "color": { + "h": 240, + "s": 100, + "l": 6.862745098039216, + "a": 1 + }, + "points": [ + "point-407", + "point-507", + "point-517" + ] + }, + { + "id": "poly-104", + "color": { + "h": 240, + "s": 100, + "l": 5.686274509803922, + "a": 1 + }, + "points": [ + "point-407", + "point-517", + "point-417" + ] + }, + { + "id": "poly-105", + "color": { + "h": 240, + "s": 100, + "l": 1.5686274509803921, + "a": 1 + }, + "points": [ + "point-417", + "point-517", + "point-527" + ] + }, + { + "id": "poly-106", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-417", + "point-527", + "point-532" + ] + }, + { + "id": "poly-107", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-417", + "point-532", + "point-432" + ] + }, + { + "id": "poly-108", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-432", + "point-532", + "point-542" + ] + }, + { + "id": "poly-109", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-432", + "point-542", + "point-442" + ] + }, + { + "id": "poly-110", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-442", + "point-542", + "point-452" + ] + }, + { + "id": "poly-111", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-452", + "point-542", + "point-557" + ] + }, + { + "id": "poly-112", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-452", + "point-557", + "point-457" + ] + }, + { + "id": "poly-113", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-457", + "point-557", + "point-357" + ] + }, + { + "id": "poly-114", + "color": { + "h": 259.44444444444446, + "s": 100, + "l": 21.176470588235293, + "a": 1 + }, + "points": [ + "point-1", + "point-571", + "point-472" + ] + }, + { + "id": "poly-115", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-472", + "point-571", + "point-577" + ] + }, + { + "id": "poly-116", + "color": { + "h": 257.2277227722772, + "s": 100, + "l": 19.80392156862745, + "a": 1 + }, + "points": [ + "point-472", + "point-577", + "point-487" + ] + }, + { + "id": "poly-117", + "color": { + "h": 252.41379310344828, + "s": 100, + "l": 17.058823529411764, + "a": 1 + }, + "points": [ + "point-487", + "point-577", + "point-587" + ] + }, + { + "id": "poly-118", + "color": { + "h": 246.57534246575347, + "s": 100, + "l": 14.313725490196077, + "a": 1 + }, + "points": [ + "point-487", + "point-587", + "point-592" + ] + }, + { + "id": "poly-119", + "color": { + "h": 246.57534246575347, + "s": 100, + "l": 14.313725490196077, + "a": 1 + }, + "points": [ + "point-487", + "point-592", + "point-497" + ] + }, + { + "id": "poly-120", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-497", + "point-592", + "point-602" + ] + }, + { + "id": "poly-121", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-497", + "point-602", + "point-507" + ] + }, + { + "id": "poly-122", + "color": { + "h": 240, + "s": 100, + "l": 5.686274509803922, + "a": 1 + }, + "points": [ + "point-507", + "point-602", + "point-612" + ] + }, + { + "id": "poly-123", + "color": { + "h": 240, + "s": 100, + "l": 5.686274509803922, + "a": 1 + }, + "points": [ + "point-507", + "point-612", + "point-517" + ] + }, + { + "id": "poly-124", + "color": { + "h": 240, + "s": 100, + "l": 1.5686274509803921, + "a": 1 + }, + "points": [ + "point-517", + "point-612", + "point-527" + ] + }, + { + "id": "poly-125", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-527", + "point-612", + "point-627" + ] + }, + { + "id": "poly-126", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-527", + "point-627", + "point-632" + ] + }, + { + "id": "poly-127", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-527", + "point-632", + "point-532" + ] + }, + { + "id": "poly-128", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-532", + "point-632", + "point-542" + ] + }, + { + "id": "poly-129", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-542", + "point-632", + "point-647" + ] + }, + { + "id": "poly-130", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-542", + "point-647", + "point-652" + ] + }, + { + "id": "poly-131", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-542", + "point-652", + "point-557" + ] + }, + { + "id": "poly-132", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-557", + "point-652", + "point-357" + ] + }, + { + "id": "poly-133", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-357", + "point-652", + "point-667" + ] + }, + { + "id": "poly-134", + "color": { + "h": 240, + "s": 100, + "l": 6.862745098039216, + "a": 1 + }, + "points": [ + "point-571", + "point-647", + "point-587" + ] + }, + { + "id": "poly-135", + "color": { + "h": 252.41379310344828, + "s": 100, + "l": 17.058823529411764, + "a": 1 + }, + "points": [ + "point-571", + "point-587", + "point-577" + ] + }, + { + "id": "poly-136", + "color": { + "h": 240, + "s": 100, + "l": 2.549019607843137, + "a": 1 + }, + "points": [ + "point-587", + "point-647", + "point-602" + ] + }, + { + "id": "poly-137", + "color": { + "h": 240, + "s": 100, + "l": 9.215686274509805, + "a": 1 + }, + "points": [ + "point-587", + "point-602", + "point-592" + ] + }, + { + "id": "poly-138", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-602", + "point-647", + "point-632" + ] + }, + { + "id": "poly-139", + "color": { + "h": 240, + "s": 100, + "l": 0.5882352941176471, + "a": 1 + }, + "points": [ + "point-602", + "point-632", + "point-612" + ] + }, + { + "id": "poly-140", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-612", + "point-632", + "point-627" + ] + }, + { + "id": "poly-141", + "color": { + "h": 0, + "s": 0, + "l": 0, + "a": 1 + }, + "points": [ + "point-647", + "point-667", + "point-652" + ] + } + ] +}; diff --git a/website/source/javascripts/app/Init.js b/website/source/javascripts/app/Init.js new file mode 100644 index 0000000000..dd3799ae2b --- /dev/null +++ b/website/source/javascripts/app/Init.js @@ -0,0 +1,84 @@ +(function( + Engine +){ + +// Quick and dirty IE detection +var isIE = (function(){ + if (window.navigator.userAgent.match('Trident')) { + return true; + } else { + return false; + } +})(); + +// isIE = true; + +var Init = { + + start: function(){ + var id = document.body.id.toLowerCase(); + + if (this.Pages[id]) { + this.Pages[id](); + } + }, + + generateAnimatedLogo: function(){ + var container, x, block; + + container = document.createElement('div'); + container.className = 'animated-logo'; + + for (x = 1; x < 5; x++) { + block = document.createElement('div'); + block.className = 'white-block block-' + x; + container.appendChild(block); + } + + return container; + }, + + initializeEngine: function(){ + var jumbotron = document.getElementById('jumbotron'), + content = document.getElementById('jumbotron-content'), + tagLine = document.getElementById('tag-line'), + canvas, galaxy; + + if (!jumbotron) { + return; + } + + galaxy = document.createElement('div'); + galaxy.id = 'galaxy-bg'; + galaxy.className = 'galaxy-bg'; + jumbotron.appendChild(galaxy); + + content.appendChild( + Init.generateAnimatedLogo() + ); + + canvas = document.createElement('canvas'); + canvas.className = 'terraform-canvas'; + + jumbotron.appendChild(canvas); + window.engine = new Engine(canvas, galaxy, tagLine); + }, + + Pages: { + 'page-home': function(){ + var jumbotron; + if (isIE) { + jumbotron = document.getElementById('jumbotron'); + jumbotron.className += ' static'; + return; + } + + Init.initializeEngine(); + } + } + +}; + +Init.start(); + +})(window.Engine); diff --git a/website/source/javascripts/app/Logo.js b/website/source/javascripts/app/Logo.js new file mode 100644 index 0000000000..8758618bb1 --- /dev/null +++ b/website/source/javascripts/app/Logo.js @@ -0,0 +1,1330 @@ +// jshint unused:false +var Logo = { + "data": { + "width": 587, + "height": 587, + "ar": 1 + }, + "points": [ + { + "id": "point-0", + "x": 0.5809199318568995, + "y": 0.7478705281090289 + }, + { + "id": "point-1", + "x": 0.8160136286201022, + "y": 0.616695059625213 + }, + { + "id": "point-2", + "x": 0.6081771720613288, + "y": 0.8943781942078366 + }, + { + "id": "point-4", + "x": 0.9761499148211243, + "y": 0.6550255536626917 + }, + { + "id": "point-5", + "x": 0.848381601362862, + "y": 0.8603066439522997 + }, + { + "id": "point-12", + "x": 0.6354344122657581, + "y": 0.9829642248722317 + }, + { + "id": "point-16", + "x": 0.5536626916524702, + "y": 0.9982964224872233 + }, + { + "id": "point-20", + "x": 0.45451448040885867, + "y": 0.9463373083475298 + }, + { + "id": "point-24", + "x": 0.48126064735945484, + "y": 0.9982964224872233 + }, + { + "id": "point-28", + "x": 0.403747870528109, + "y": 0.994037478705281 + }, + { + "id": "point-32", + "x": 0.18143100511073254, + "y": 0.8858603066439524 + }, + { + "id": "point-36", + "x": 0.22998296422487224, + "y": 0.8057921635434411 + }, + { + "id": "point-40", + "x": 0.3373083475298126, + "y": 0.7052810902896082 + }, + { + "id": "point-44", + "x": 0.5143100511073253, + "y": 0.6933560477001702 + }, + { + "id": "point-56", + "x": 0.8918228279386712, + "y": 0.46337308347529815 + }, + { + "id": "point-60", + "x": 0.9974446337308348, + "y": 0.5366269165247018 + }, + { + "id": "point-64", + "x": 0.9574105621805792, + "y": 0.368824531516184 + }, + { + "id": "point-68", + "x": 0.9761499148211243, + "y": 0.36201022146507666 + }, + { + "id": "point-72", + "x": 0.6626916524701874, + "y": 0.43781942078364566 + }, + { + "id": "point-84", + "x": 0.4335604770017036, + "y": 0.5698466780238501 + }, + { + "id": "point-92", + "x": 0.11158432708688246, + "y": 0.8197614991482112 + }, + { + "id": "point-96", + "x": 0.09540034071550256, + "y": 0.6669505962521295 + }, + { + "id": "point-104", + "x": 0.05536626916524703, + "y": 0.7257240204429302 + }, + { + "id": "point-108", + "x": 0.03492333901192504, + "y": 0.6831345826235093 + }, + { + "id": "point-112", + "x": 0.15417376490630325, + "y": 0.4892674616695059 + }, + { + "id": "point-116", + "x": 0.22487223168654175, + "y": 0.4599659284497445 + }, + { + "id": "point-124", + "x": 0.2785349233390119, + "y": 0.35945485519591147 + }, + { + "id": "point-128", + "x": 0.48722316865417375, + "y": 0.35945485519591147 + }, + { + "id": "point-136", + "x": 0.5809199318568995, + "y": 0.2925042589437819 + }, + { + "id": "point-140", + "x": 0.889267461669506, + "y": 0.27649063032367976 + }, + { + "id": "point-152", + "x": 0.944633730834753, + "y": 0.2737649063032368 + }, + { + "id": "point-160", + "x": 0.8802385008517888, + "y": 0.18177172061328795 + }, + { + "id": "point-168", + "x": 0.5809199318568995, + "y": 0.19471890971039182 + }, + { + "id": "point-176", + "x": 0.7989778534923339, + "y": 0.10391822827938672 + }, + { + "id": "point-180", + "x": 0.6218057921635435, + "y": 0.018739352640545145 + }, + { + "id": "point-184", + "x": 0.5252129471890972, + "y": 0.0005110732538330494 + }, + { + "id": "point-188", + "x": 0.3889267461669506, + "y": 0.09761499148211243 + }, + { + "id": "point-192", + "x": 0.38126064735945486, + "y": 0.018739352640545145 + }, + { + "id": "point-196", + "x": 0.30153321976149916, + "y": 0.04258943781942079 + }, + { + "id": "point-200", + "x": 0.2969335604770017, + "y": 0.09761499148211243 + }, + { + "id": "point-216", + "x": 0.049403747870528106, + "y": 0.3083475298126065 + }, + { + "id": "point-228", + "x": 0.002214650766609881, + "y": 0.47155025553662694 + }, + { + "id": "point-232", + "x": 0.0005110732538330494, + "y": 0.5289608177172062 + }, + { + "id": "point-244", + "x": 0.17325383304940373, + "y": 0.12180579216354344 + } + ], + "polygons": [ + { + "id": "poly-0", + "color": { + "h": 264.688995215311, + "s": 100, + "l": 59.01960784313726, + "a": 1 + }, + "points": [ + "point-0", + "point-1", + "point-2" + ] + }, + { + "id": "poly-1", + "color": { + "h": 268.3076923076923, + "s": 100, + "l": 61.76470588235294, + "a": 1 + }, + "points": [ + "point-4", + "point-5", + "point-1" + ] + }, + { + "id": "poly-2", + "color": { + "h": 267.1641791044776, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-5", + "point-2", + "point-1" + ] + }, + { + "id": "poly-3", + "color": { + "h": 268.3076923076923, + "s": 100, + "l": 61.76470588235294, + "a": 1 + }, + "points": [ + "point-12", + "point-2", + "point-5" + ] + }, + { + "id": "poly-4", + "color": { + "h": 267.1641791044776, + "s": 100, + "l": 60.588235294117645, + "a": 1 + }, + "points": [ + "point-16", + "point-12", + "point-2" + ] + }, + { + "id": "poly-5", + "color": { + "h": 264.9, + "s": 92.59259259259261, + "l": 57.647058823529406, + "a": 1 + }, + "points": [ + "point-20", + "point-2", + "point-16" + ] + }, + { + "id": "poly-6", + "color": { + "h": 264.9, + "s": 92.59259259259261, + "l": 57.647058823529406, + "a": 1 + }, + "points": [ + "point-24", + "point-20", + "point-16" + ] + }, + { + "id": "poly-7", + "color": { + "h": 264.97461928934007, + "s": 85.28138528138528, + "l": 54.70588235294118, + "a": 1 + }, + "points": [ + "point-28", + "point-20", + "point-24" + ] + }, + { + "id": "poly-8", + "color": { + "h": 265.4347826086956, + "s": 80, + "l": 45.09803921568628, + "a": 1 + }, + "points": [ + "point-32", + "point-20", + "point-28" + ] + }, + { + "id": "poly-9", + "color": { + "h": 265.4347826086956, + "s": 80, + "l": 45.09803921568628, + "a": 1 + }, + "points": [ + "point-36", + "point-32", + "point-20" + ] + }, + { + "id": "poly-10", + "color": { + "h": 265.4347826086956, + "s": 80, + "l": 45.09803921568628, + "a": 1 + }, + "points": [ + "point-40", + "point-36", + "point-20" + ] + }, + { + "id": "poly-11", + "color": { + "h": 265.48387096774195, + "s": 76.22950819672131, + "l": 47.84313725490196, + "a": 1 + }, + "points": [ + "point-44", + "point-20", + "point-40" + ] + }, + { + "id": "poly-12", + "color": { + "h": 264.61538461538464, + "s": 79.59183673469387, + "l": 51.9607843137255, + "a": 1 + }, + "points": [ + "point-0", + "point-44", + "point-20" + ] + }, + { + "id": "poly-13", + "color": { + "h": 264.9, + "s": 92.59259259259261, + "l": 57.647058823529406, + "a": 1 + }, + "points": [ + "point-0", + "point-20", + "point-2" + ] + }, + { + "id": "poly-14", + "color": { + "h": 264.61538461538464, + "s": 79.59183673469387, + "l": 51.9607843137255, + "a": 1 + }, + "points": [ + "point-56", + "point-1", + "point-4" + ] + }, + { + "id": "poly-15", + "color": { + "h": 264.61538461538464, + "s": 79.59183673469387, + "l": 51.9607843137255, + "a": 1 + }, + "points": [ + "point-60", + "point-4", + "point-56" + ] + }, + { + "id": "poly-16", + "color": { + "h": 263.64705882352945, + "s": 86.73469387755101, + "l": 38.43137254901961, + "a": 1 + }, + "points": [ + "point-64", + "point-56", + "point-60" + ] + }, + { + "id": "poly-17", + "color": { + "h": 264.9056603773585, + "s": 90.85714285714286, + "l": 34.31372549019608, + "a": 1 + }, + "points": [ + "point-68", + "point-64", + "point-60" + ] + }, + { + "id": "poly-18", + "color": { + "h": 263.64705882352945, + "s": 86.73469387755101, + "l": 38.43137254901961, + "a": 1 + }, + "points": [ + "point-72", + "point-56", + "point-1" + ] + }, + { + "id": "poly-19", + "color": { + "h": 265.4347826086956, + "s": 80, + "l": 45.09803921568628, + "a": 1 + }, + "points": [ + "point-0", + "point-72", + "point-1" + ] + }, + { + "id": "poly-20", + "color": { + "h": 264.20454545454544, + "s": 79.27927927927928, + "l": 43.529411764705884, + "a": 1 + }, + "points": [ + "point-72", + "point-0", + "point-44" + ] + }, + { + "id": "poly-21", + "color": { + "h": 264.2307692307692, + "s": 95.12195121951221, + "l": 32.15686274509804, + "a": 1 + }, + "points": [ + "point-84", + "point-44", + "point-72" + ] + }, + { + "id": "poly-22", + "color": { + "h": 263.64705882352945, + "s": 86.73469387755101, + "l": 38.43137254901961, + "a": 1 + }, + "points": [ + "point-40", + "point-84", + "point-44" + ] + }, + { + "id": "poly-23", + "color": { + "h": 264.9056603773585, + "s": 90.85714285714286, + "l": 34.31372549019608, + "a": 1 + }, + "points": [ + "point-92", + "point-32", + "point-36" + ] + }, + { + "id": "poly-24", + "color": { + "h": 264.2307692307692, + "s": 95.12195121951221, + "l": 32.15686274509804, + "a": 1 + }, + "points": [ + "point-96", + "point-92", + "point-36" + ] + }, + { + "id": "poly-25", + "color": { + "h": 264.9056603773585, + "s": 90.85714285714286, + "l": 34.31372549019608, + "a": 1 + }, + "points": [ + "point-40", + "point-96", + "point-36" + ] + }, + { + "id": "poly-26", + "color": { + "h": 264.2307692307692, + "s": 95.12195121951221, + "l": 32.15686274509804, + "a": 1 + }, + "points": [ + "point-104", + "point-92", + "point-96" + ] + }, + { + "id": "poly-27", + "color": { + "h": 261.6, + "s": 100, + "l": 14.705882352941178, + "a": 1 + }, + "points": [ + "point-108", + "point-104", + "point-96" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-28", + "color": { + "h": 261.6, + "s": 100, + "l": 14.705882352941178, + "a": 1 + }, + "points": [ + "point-112", + "point-40", + "point-96" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-29", + "color": { + "h": 257.910447761194, + "s": 100, + "l": 13.137254901960786, + "a": 1 + }, + "points": [ + "point-116", + "point-112", + "point-40" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-30", + "color": { + "h": 262.8571428571429, + "s": 100, + "l": 16.470588235294116, + "a": 1 + }, + "points": [ + "point-84", + "point-40", + "point-116" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-31", + "color": { + "h": 252.00000000000003, + "s": 100, + "l": 9.803921568627452, + "a": 1 + }, + "points": [ + "point-124", + "point-84", + "point-116" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-32", + "color": { + "h": 252.00000000000003, + "s": 100, + "l": 9.803921568627452, + "a": 1 + }, + "points": [ + "point-128", + "point-84", + "point-124" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-33", + "color": { + "h": 257.910447761194, + "s": 100, + "l": 13.137254901960786, + "a": 1 + }, + "points": [ + "point-72", + "point-128", + "point-84" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-34", + "color": { + "h": 252.00000000000003, + "s": 100, + "l": 9.803921568627452, + "a": 1 + }, + "points": [ + "point-136", + "point-128", + "point-72" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-35", + "color": { + "h": 253.44827586206898, + "s": 100, + "l": 11.372549019607844, + "a": 1 + }, + "points": [ + "point-140", + "point-136", + "point-72" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-36", + "color": { + "h": 261.6, + "s": 100, + "l": 14.705882352941178, + "a": 1 + }, + "points": [ + "point-140", + "point-56", + "point-72" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-37", + "color": { + "h": 262.8571428571429, + "s": 100, + "l": 16.470588235294116, + "a": 1 + }, + "points": [ + "point-64", + "point-56", + "point-140" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-38", + "color": { + "h": 259.4366197183098, + "s": 100, + "l": 13.92156862745098, + "a": 1 + }, + "points": [ + "point-152", + "point-140", + "point-64" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-39", + "color": { + "h": 259.4366197183098, + "s": 100, + "l": 13.92156862745098, + "a": 1 + }, + "points": [ + "point-68", + "point-64", + "point-152" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-40", + "color": { + "h": 253.44827586206898, + "s": 100, + "l": 11.372549019607844, + "a": 1 + }, + "points": [ + "point-160", + "point-140", + "point-152" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-41", + "color": { + "h": 245.58139534883722, + "s": 100, + "l": 8.431372549019608, + "a": 1 + }, + "points": [ + "point-136", + "point-160", + "point-140" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-42", + "color": { + "h": 246.15384615384613, + "s": 100, + "l": 7.647058823529412, + "a": 1 + }, + "points": [ + "point-168", + "point-128", + "point-136" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-43", + "color": { + "h": 245.58139534883722, + "s": 100, + "l": 8.431372549019608, + "a": 1 + }, + "points": [ + "point-160", + "point-168", + "point-136" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-44", + "color": { + "h": 246.15384615384613, + "s": 100, + "l": 7.647058823529412, + "a": 1 + }, + "points": [ + "point-176", + "point-160", + "point-168" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-45", + "color": { + "h": 246.15384615384613, + "s": 100, + "l": 7.647058823529412, + "a": 1 + }, + "points": [ + "point-180", + "point-168", + "point-176" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-46", + "color": { + "h": 240, + "s": 100, + "l": 4.509803921568627, + "a": 1 + }, + "points": [ + "point-184", + "point-168", + "point-180" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-47", + "color": { + "h": 240, + "s": 100, + "l": 4.509803921568627, + "a": 1 + }, + "points": [ + "point-188", + "point-168", + "point-184" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-48", + "color": { + "h": 240, + "s": 100, + "l": 4.509803921568627, + "a": 1 + }, + "points": [ + "point-192", + "point-188", + "point-184" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-49", + "color": { + "h": 240, + "s": 100, + "l": 4.509803921568627, + "a": 1 + }, + "points": [ + "point-196", + "point-188", + "point-192" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-50", + "color": { + "h": 240, + "s": 100, + "l": 0.5882352941176471, + "a": 1 + }, + "points": [ + "point-200", + "point-196", + "point-188" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-51", + "color": { + "h": 240, + "s": 100, + "l": 3.3333333333333335, + "a": 1 + }, + "points": [ + "point-188", + "point-124", + "point-200" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-52", + "color": { + "h": 240, + "s": 100, + "l": 5.294117647058823, + "a": 1 + }, + "points": [ + "point-188", + "point-124", + "point-128" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-53", + "color": { + "h": 245.1428571428571, + "s": 100, + "l": 6.862745098039216, + "a": 1 + }, + "points": [ + "point-188", + "point-128", + "point-168" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-54", + "color": { + "h": 240, + "s": 100, + "l": 3.3333333333333335, + "a": 1 + }, + "points": [ + "point-216", + "point-200", + "point-124" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-55", + "color": { + "h": 240, + "s": 100, + "l": 5.294117647058823, + "a": 1 + }, + "points": [ + "point-216", + "point-116", + "point-124" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-56", + "color": { + "h": 245.1428571428571, + "s": 100, + "l": 6.862745098039216, + "a": 1 + }, + "points": [ + "point-112", + "point-216", + "point-116" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-57", + "color": { + "h": 240, + "s": 100, + "l": 5.294117647058823, + "a": 1 + }, + "points": [ + "point-228", + "point-216", + "point-112" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-58", + "color": { + "h": 249.13043478260872, + "s": 100, + "l": 9.019607843137255, + "a": 1 + }, + "points": [ + "point-232", + "point-112", + "point-96" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-59", + "color": { + "h": 253.44827586206898, + "s": 100, + "l": 11.372549019607844, + "a": 1 + }, + "points": [ + "point-108", + "point-96", + "point-232" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-60", + "color": { + "h": 240, + "s": 100, + "l": 5.294117647058823, + "a": 1 + }, + "points": [ + "point-228", + "point-112", + "point-232" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-61", + "color": { + "h": 240, + "s": 100, + "l": 0.5882352941176471, + "a": 1 + }, + "points": [ + "point-244", + "point-216", + "point-200" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + }, + { + "id": "poly-62", + "color": { + "h": 240, + "s": 100, + "l": 0.5882352941176471, + "a": 1 + }, + "points": [ + "point-196", + "point-200", + "point-244" + ], + "stroke": { + "h": 262.24719101123594, + "s": 60.544217687074834, + "l": 28.82352941176471, + "a": 0.5 + } + } + ] +}; diff --git a/website/source/javascripts/app/Puller.js b/website/source/javascripts/app/Puller.js new file mode 100644 index 0000000000..2df85c7338 --- /dev/null +++ b/website/source/javascripts/app/Puller.js @@ -0,0 +1,136 @@ +(function( + Engine, + Vector +){ + +var Puller = function(x, y){ + this.pos.x = x; + this.pos.y = y; + this.pos = Vector.coerce(this.pos); + this.home = this.pos.clone(); + this.accel = Vector.coerce(this.accel); + this.vel = Vector.coerce(this.vel); +}; + +Puller.prototype = { + + fillStyle: '#ffffff', + radius: 5, + + maxSpeed: 160, + maxForce: 50, + + pos: { + x: 0, + y: 0 + }, + + accel: { + x: 0, + y: 0 + }, + + vel: { + x: 0, + y: 0 + }, + + aRad: 200, + + safety: 0.25, + + update: function(engine){ + var distanceToMouse = this.distanceTo(engine.mouse), + toHome, mag, safety; + // distanceToHome = this.distanceTo(this.home); + + this.accel.mult(0); + + if (distanceToMouse < this.aRad) { + this.toChase(engine.mouse); + } + + this.toChase(this.home, this.maxForce / 2); + + this.vel.add(this.accel); + this.pos.add( + Vector.mult(this.vel, engine.tick) + ); + + toHome = Vector.sub(this.home, this.pos); + mag = toHome.mag(); + safety = this.aRad * (this.safety * 3); + if (mag > this.aRad - safety) { + toHome.normalize(); + toHome.mult(this.aRad - safety); + this.pos = Vector.sub(this.home, toHome); + } + }, + + toChase: function(target, maxForce){ + var desired, steer, distance, mult, safety; + + maxForce = maxForce || this.maxForce; + + target = Vector.coerce(target); + desired = Vector.sub(target, this.pos); + distance = desired.mag(); + desired.normalize(); + + safety = this.aRad * this.safety; + + if (distance < safety) { + mult = Engine.map(distance, 0, safety, 0, this.maxSpeed); + } else if (distance > this.aRad - safety){ + mult = Engine.map(this.aRad - distance, 0, safety, 0, this.maxSpeed); + } else { + mult = this.maxSpeed; + } + + desired.mult(mult); + + steer = Vector.sub(desired, this.vel); + steer.limit(maxForce); + this.accel.add(steer); + }, + + draw: function(ctx, scale){ + // ctx.beginPath(); + // ctx.arc( + // this.home.x * scale, + // this.home.y * scale, + // this.aRad * scale, + // 0, + // Math.PI * 2, + // false + // ); + // ctx.fillStyle = 'rgba(255,255,255,0.1)'; + // ctx.fill(); + + ctx.beginPath(); + ctx.arc( + this.pos.x * scale, + this.pos.y * scale, + this.radius * scale, + 0, + Math.PI * 2, + false + ); + ctx.fillStyle = this.fillStyle; + ctx.fill(); + + }, + + distanceTo: function(target) { + var xd = this.home.x - target.x; + var yd = this.home.y - target.y; + return Math.sqrt(xd * xd + yd * yd ); + } +}; + +window.Puller = Puller; + +})( + window.Engine, + window.Vector +); diff --git a/website/source/javascripts/app/app.js b/website/source/javascripts/app/app.js deleted file mode 100644 index c75c3614ef..0000000000 --- a/website/source/javascripts/app/app.js +++ /dev/null @@ -1,20 +0,0 @@ -// -// app.js -// - -var APP = (function() { - - function initialize (){ - APP.Utils.runIfClassNamePresent('page-home', initHome); - } - - function initHome() { - APP.Homepage.init(); - } - - //api - return { - initialize: initialize - } - -})(); diff --git a/website/source/javascripts/app/deploy/site.js b/website/source/javascripts/app/deploy/site.js deleted file mode 100644 index 098863ffde..0000000000 --- a/website/source/javascripts/app/deploy/site.js +++ /dev/null @@ -1,101 +0,0 @@ -// -// app.js -// - -var APP = (function() { - - function initialize (){ - APP.Utils.runIfClassNamePresent('page-home', initHome); - } - - function initHome() { - APP.Homepage.init(); - } - - //api - return { - initialize: initialize - } - -})(); -;// -// util.js -// -var APP = APP || {}; - -APP.Utils = (function () { - return { - //check for mobile user agents - isMobile : (function(){ - if( navigator.userAgent.match(/Android/i) - || navigator.userAgent.match(/webOS/i) - || navigator.userAgent.match(/iPhone/i) - //|| navigator.userAgent.match(/iPad/i) - || navigator.userAgent.match(/iPod/i) - || navigator.userAgent.match(/BlackBerry/i) - || navigator.userAgent.match(/Windows Phone/i) - ){ - return true; - } - else { - return false; - } - })(), - - runIfClassNamePresent: function(selector, initFunction) { - var elms = document.getElementsByClassName(selector); - if (elms.length > 0) { - initFunction(); - } - } - } - -}());;//homepage.js - -var APP = APP || {}; - -(function () { - APP.Homepage = (function () { - return { - - ui : null, - - init: function () { - var _this = this; - - //cache elements - this.ui = { - $doc: $(window), - $hero: $('#jumbotron'), - $collapse: $('.navbar-collapse') - } - - this.addEventListeners(); - - }, - - addEventListeners: function(){ - var _this = this; - - if(APP.Utils.isMobile) - return; - - _this.ui.$doc.scroll(function() { - - //if collapseable menu is open dont do parrallax. It looks wonky. Bootstrap conflict - if( _this.ui.$collapse.hasClass('in')) - return; - - var top = _this.ui.$doc.scrollTop(), - speedAdj = (top*0.8), - speedAdjOffset = speedAdj - top; - - _this.ui.$hero.css('webkitTransform', 'translate(0, '+ speedAdj +'px)'); - _this.ui.$hero.find('.container').css('webkitTransform', 'translate(0, '+ speedAdjOffset +'px)'); - }) - } - } - }()); - -}(jQuery, this)); - diff --git a/website/source/javascripts/app/deploy/site.min.js b/website/source/javascripts/app/deploy/site.min.js deleted file mode 100644 index ea3bd58f64..0000000000 --- a/website/source/javascripts/app/deploy/site.min.js +++ /dev/null @@ -1 +0,0 @@ -var APP=function(){function a(){APP.Utils.runIfClassNamePresent("page-home",b)}function b(){APP.Homepage.init()}return{initialize:a}}(),APP=APP||{};APP.Utils=function(){return{isMobile:function(){return navigator.userAgent.match(/Android/i)||navigator.userAgent.match(/webOS/i)||navigator.userAgent.match(/iPhone/i)||navigator.userAgent.match(/iPod/i)||navigator.userAgent.match(/BlackBerry/i)||navigator.userAgent.match(/Windows Phone/i)?!0:!1}(),runIfClassNamePresent:function(a,b){var c=document.getElementsByClassName(a);c.length>0&&b()}}}();var APP=APP||{};!function(){APP.Homepage=function(){return{ui:null,init:function(){this.ui={$doc:$(window),$hero:$("#jumbotron"),$collapse:$(".navbar-collapse")},this.addEventListeners()},addEventListeners:function(){var a=this;APP.Utils.isMobile||a.ui.$doc.scroll(function(){if(!a.ui.$collapse.hasClass("in")){var b=a.ui.$doc.scrollTop(),c=.8*b,d=c-b;a.ui.$hero.css("webkitTransform","translate(0, "+c+"px)"),a.ui.$hero.find(".container").css("webkitTransform","translate(0, "+d+"px)")}})}}}()}(jQuery,this); \ No newline at end of file diff --git a/website/source/javascripts/app/homepage.js b/website/source/javascripts/app/homepage.js deleted file mode 100644 index 9af3e6d7c2..0000000000 --- a/website/source/javascripts/app/homepage.js +++ /dev/null @@ -1,49 +0,0 @@ -//homepage.js - -var APP = APP || {}; - -(function () { - APP.Homepage = (function () { - return { - - ui : null, - - init: function () { - var _this = this; - - //cache elements - this.ui = { - $doc: $(window), - $hero: $('#jumbotron'), - $collapse: $('.navbar-collapse') - } - - this.addEventListeners(); - - }, - - addEventListeners: function(){ - var _this = this; - - if(APP.Utils.isMobile) - return; - - _this.ui.$doc.scroll(function() { - - //if collapseable menu is open dont do parrallax. It looks wonky. Bootstrap conflict - if( _this.ui.$collapse.hasClass('in')) - return; - - var top = _this.ui.$doc.scrollTop(), - speedAdj = (top*0.8), - speedAdjOffset = speedAdj - top; - - _this.ui.$hero.css('webkitTransform', 'translate(0, '+ speedAdj +'px)'); - _this.ui.$hero.find('.container').css('webkitTransform', 'translate(0, '+ speedAdjOffset +'px)'); - }) - } - } - }()); - -}(jQuery, this)); - diff --git a/website/source/javascripts/app/util.js b/website/source/javascripts/app/util.js deleted file mode 100644 index f6acd8eb4a..0000000000 --- a/website/source/javascripts/app/util.js +++ /dev/null @@ -1,33 +0,0 @@ -// -// util.js -// -var APP = APP || {}; - -APP.Utils = (function () { - return { - //check for mobile user agents - isMobile : (function(){ - if( navigator.userAgent.match(/Android/i) - || navigator.userAgent.match(/webOS/i) - || navigator.userAgent.match(/iPhone/i) - //|| navigator.userAgent.match(/iPad/i) - || navigator.userAgent.match(/iPod/i) - || navigator.userAgent.match(/BlackBerry/i) - || navigator.userAgent.match(/Windows Phone/i) - ){ - return true; - } - else { - return false; - } - })(), - - runIfClassNamePresent: function(selector, initFunction) { - var elms = document.getElementsByClassName(selector); - if (elms.length > 0) { - initFunction(); - } - } - } - -}()); \ No newline at end of file diff --git a/website/source/javascripts/classy.js b/website/source/javascripts/classy.js deleted file mode 100644 index d001fc6bee..0000000000 --- a/website/source/javascripts/classy.js +++ /dev/null @@ -1,158 +0,0 @@ -/** - * Classy - classy classes for JavaScript - * - * :copyright: (c) 2011 by Armin Ronacher. - * :license: BSD. - */ - -;(function(undefined) { - var - CLASSY_VERSION = '1.4', - root = this, - old_class = root.Class, - disable_constructor = false; - - /* we check if $super is in use by a class if we can. But first we have to - check if the JavaScript interpreter supports that. This also matches - to false positives later, but that does not do any harm besides slightly - slowing calls down. */ - var probe_super = (function(){$super();}).toString().indexOf('$super') > 0; - function usesSuper(obj) { - return !probe_super || /\B\$super\b/.test(obj.toString()); - } - - /* helper function to set the attribute of something to a value or - removes it if the value is undefined. */ - function setOrUnset(obj, key, value) { - if (value === undefined) - delete obj[key]; - else - obj[key] = value; - } - - /* gets the own property of an object */ - function getOwnProperty(obj, name) { - return Object.prototype.hasOwnProperty.call(obj, name) - ? obj[name] : undefined; - } - - /* instanciate a class without calling the constructor */ - function cheapNew(cls) { - disable_constructor = true; - var rv = new cls; - disable_constructor = false; - return rv; - } - - /* the base class we export */ - var Class = function() {}; - - /* restore the global Class name and pass it to a function. This allows - different versions of the classy library to be used side by side and - in combination with other libraries. */ - Class.$noConflict = function() { - try { - setOrUnset(root, 'Class', old_class); - } - catch (e) { - // fix for IE that does not support delete on window - root.Class = old_class; - } - return Class; - }; - - /* what version of classy are we using? */ - Class.$classyVersion = CLASSY_VERSION; - - /* extend functionality */ - Class.$extend = function(properties) { - var super_prototype = this.prototype; - - /* disable constructors and instanciate prototype. Because the - prototype can't raise an exception when created, we are safe - without a try/finally here. */ - var prototype = cheapNew(this); - - /* copy all properties of the includes over if there are any */ - if (properties.__include__) - for (var i = 0, n = properties.__include__.length; i != n; ++i) { - var mixin = properties.__include__[i]; - for (var name in mixin) { - var value = getOwnProperty(mixin, name); - if (value !== undefined) - prototype[name] = mixin[name]; - } - } - - /* copy class vars from the superclass */ - properties.__classvars__ = properties.__classvars__ || {}; - if (prototype.__classvars__) - for (var key in prototype.__classvars__) - if (!properties.__classvars__[key]) { - var value = getOwnProperty(prototype.__classvars__, key); - properties.__classvars__[key] = value; - } - - /* copy all properties over to the new prototype */ - for (var name in properties) { - var value = getOwnProperty(properties, name); - if (name === '__include__' || - value === undefined) - continue; - - prototype[name] = typeof value === 'function' && usesSuper(value) ? - (function(meth, name) { - return function() { - var old_super = getOwnProperty(this, '$super'); - this.$super = super_prototype[name]; - try { - return meth.apply(this, arguments); - } - finally { - setOrUnset(this, '$super', old_super); - } - }; - })(value, name) : value - } - - /* dummy constructor */ - var rv = function() { - if (disable_constructor) - return; - var proper_this = root === this ? cheapNew(arguments.callee) : this; - if (proper_this.__init__) - proper_this.__init__.apply(proper_this, arguments); - proper_this.$class = rv; - return proper_this; - } - - /* copy all class vars over of any */ - for (var key in properties.__classvars__) { - var value = getOwnProperty(properties.__classvars__, key); - if (value !== undefined) - rv[key] = value; - } - - /* copy prototype and constructor over, reattach $extend and - return the class */ - rv.prototype = prototype; - rv.constructor = rv; - rv.$extend = Class.$extend; - rv.$withData = Class.$withData; - return rv; - }; - - /* instanciate with data functionality */ - Class.$withData = function(data) { - var rv = cheapNew(this); - for (var key in data) { - var value = getOwnProperty(data, key); - if (value !== undefined) - rv[key] = value; - } - return rv; - }; - - /* export the class */ - root.Class = Class; -})(); diff --git a/website/source/javascripts/lib/Base.js b/website/source/javascripts/lib/Base.js new file mode 100644 index 0000000000..504e2beea1 --- /dev/null +++ b/website/source/javascripts/lib/Base.js @@ -0,0 +1,145 @@ +/* + Based on Base.js 1.1a (c) 2006-2010, Dean Edwards + Updated to pass JSHint and converted into a module by Kenneth Powers + License: http://www.opensource.org/licenses/mit-license.php +*/ +/*global define:true module:true*/ +/*jshint eqeqeq:true*/ +(function (name, global, definition) { + if (typeof module !== 'undefined') { + module.exports = definition(); + } else if (typeof define !== 'undefined' && typeof define.amd === 'object') { + define(definition); + } else { + global[name] = definition(); + } +})('Base', this, function () { + // Base Object + var Base = function () {}; + + // Implementation + Base.extend = function (_instance, _static) { // subclass + var extend = Base.prototype.extend; + // build the prototype + Base._prototyping = true; + var proto = new this(); + extend.call(proto, _instance); + proto.base = function () { + // call this method from any other method to invoke that method's ancestor + }; + delete Base._prototyping; + // create the wrapper for the constructor function + //var constructor = proto.constructor.valueOf(); //-dean + var constructor = proto.constructor; + var klass = proto.constructor = function () { + if (!Base._prototyping) { + if (this._constructing || this.constructor === klass) { // instantiation + this._constructing = true; + constructor.apply(this, arguments); + delete this._constructing; + } else if (arguments[0] !== null) { // casting + return (arguments[0].extend || extend).call(arguments[0], proto); + } + } + }; + // build the class interface + klass.ancestor = this; + klass.extend = this.extend; + klass.forEach = this.forEach; + klass.implement = this.implement; + klass.prototype = proto; + klass.toString = this.toString; + klass.valueOf = function (type) { + return (type === 'object') ? klass : constructor.valueOf(); + }; + extend.call(klass, _static); + // class initialization + if (typeof klass.init === 'function') klass.init(); + return klass; + }; + + Base.prototype = { + extend: function (source, value) { + if (arguments.length > 1) { // extending with a name/value pair + var ancestor = this[source]; + if (ancestor && (typeof value === 'function') && // overriding a method? + // the valueOf() comparison is to avoid circular references + (!ancestor.valueOf || ancestor.valueOf() !== value.valueOf()) && /\bbase\b/.test(value)) { + // get the underlying method + var method = value.valueOf(); + // override + value = function () { + var previous = this.base || Base.prototype.base; + this.base = ancestor; + var returnValue = method.apply(this, arguments); + this.base = previous; + return returnValue; + }; + // point to the underlying method + value.valueOf = function (type) { + return (type === 'object') ? value : method; + }; + value.toString = Base.toString; + } + this[source] = value; + } else if (source) { // extending with an object literal + var extend = Base.prototype.extend; + // if this object has a customized extend method then use it + if (!Base._prototyping && typeof this !== 'function') { + extend = this.extend || extend; + } + var proto = { + toSource: null + }; + // do the "toString" and other methods manually + var hidden = ['constructor', 'toString', 'valueOf']; + // if we are prototyping then include the constructor + for (var i = Base._prototyping ? 0 : 1; i < hidden.length; i++) { + var h = hidden[i]; + if (source[h] !== proto[h]) + extend.call(this, h, source[h]); + } + // copy each of the source object's properties to this object + for (var key in source) { + if (!proto[key]) extend.call(this, key, source[key]); + } + } + return this; + } + }; + + // initialize + Base = Base.extend({ + constructor: function () { + this.extend(arguments[0]); + } + }, { + ancestor: Object, + version: '1.1', + forEach: function (object, block, context) { + for (var key in object) { + if (this.prototype[key] === undefined) { + block.call(context, object[key], key, object); + } + } + }, + implement: function () { + for (var i = 0; i < arguments.length; i++) { + if (typeof arguments[i] === 'function') { + // if it's a function, call it + arguments[i](this.prototype); + } else { + // add the interface using the extend method + this.prototype.extend(arguments[i]); + } + } + return this; + }, + toString: function () { + return String(this.valueOf()); + } + }); + + // Return Base implementation + return Base; +}); diff --git a/website/source/javascripts/lib/Chainable.js b/website/source/javascripts/lib/Chainable.js new file mode 100644 index 0000000000..edb7f17570 --- /dev/null +++ b/website/source/javascripts/lib/Chainable.js @@ -0,0 +1,74 @@ +(function(){ + +var Chainable = function(){ + this._chain = []; + this._cycle = this._cycle.bind(this); +}; + +Chainable.prototype._running = false; + +Chainable.prototype.start = function(){ + if (this._running || !this._chain.length) { + return this; + } + this._running = true; + return this._cycle(); +}; + +Chainable.prototype.reset = function(){ + if (!this._running) { + return this; + } + clearTimeout(this._timer); + this._timer = null; + this._chain.length = 0; + this._running = false; + return this; +}; + +Chainable.prototype._cycle = function(){ + var current; + if (!this._chain.length) { + return this.reset(); + } + + current = this._chain.shift(); + + if (current.type === 'function') { + current.func.apply(current.scope, current.args); + current = null; + return this._cycle(); + } + if (current.type === 'wait') { + clearTimeout(this._timer); + this._timer = setTimeout(this._cycle, current.time || 0); + current = null; + } + + return this; +}; + +Chainable.prototype.then = Chainable.prototype.exec = function(func, scope, args){ + this._chain.push({ + type : 'function', + + func : func, + scope : scope || window, + args : args || [] + }); + + return this.start(); +}; + +Chainable.prototype.wait = function(time){ + this._chain.push({ + type : 'wait', + time : time + }); + + return this.start(); +}; + +window.Chainable = Chainable; + +})(); diff --git a/website/source/javascripts/lib/Function.prototype.bind.js b/website/source/javascripts/lib/Function.prototype.bind.js new file mode 100644 index 0000000000..82c3cb6c68 --- /dev/null +++ b/website/source/javascripts/lib/Function.prototype.bind.js @@ -0,0 +1,21 @@ +if (!Function.prototype.bind) { + Function.prototype.bind = function (oThis) { + if (typeof this !== "function") { + throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); + } + + var aArgs = Array.prototype.slice.call(arguments, 1), + fToBind = this, + fNOP = function () {}, + fBound = function () { + return fToBind.apply(this instanceof fNOP && oThis ? + this : oThis, + aArgs.concat(Array.prototype.slice.call(arguments))); + }; + + fNOP.prototype = this.prototype; + fBound.prototype = new fNOP(); + + return fBound; + }; +} diff --git a/website/source/javascripts/lib/String.substitute.js b/website/source/javascripts/lib/String.substitute.js new file mode 100644 index 0000000000..da2b52a387 --- /dev/null +++ b/website/source/javascripts/lib/String.substitute.js @@ -0,0 +1,14 @@ +(function(String){ + +if (String.prototype.substitute) { + return; +} + +String.prototype.substitute = function(object, regexp){ + return String(this).replace(regexp || (/\\?\{([^{}]+)\}/g), function(match, name){ + if (match.charAt(0) == '\\') return match.slice(1); + return (object[name] !== null) ? object[name] : ''; + }); +}; + +})(String); diff --git a/website/source/javascripts/lib/Vector.js b/website/source/javascripts/lib/Vector.js new file mode 100644 index 0000000000..0334c7ac79 --- /dev/null +++ b/website/source/javascripts/lib/Vector.js @@ -0,0 +1,111 @@ +(function(global){ 'use strict'; + +var Vector = function(x, y){ + this.x = x || 0; + this.y = y || 0; +}; + +Vector.prototype = { + + clone: function(){ + return new Vector(this.x, this.y); + }, + + add: function(vec){ + this.x += vec.x; + this.y += vec.y; + return this; + }, + + sub: function(vec){ + this.x -= vec.x; + this.y -= vec.y; + return this; + }, + + subVal: function(val){ + this.x -= val; + this.y -= val; + return this; + }, + + mult: function(mul){ + this.x *= mul; + this.y *= mul; + return this; + }, + + div: function(div){ + if (div === 0) { + return this; + } + this.x /= div; + this.y /= div; + return this; + }, + + mag: function(){ + return Math.sqrt( + this.x * this.x + + this.y * this.y + ); + }, + + limit: function(max){ + if (this.mag() > max) { + this.normalize(); + this.mult(max); + } + return this; + }, + + normalize: function(){ + var mag = this.mag(); + if (mag === 0) { + return this; + } + this.div(mag); + return this; + }, + + heading: function(){ + return Math.atan2(this.y, this.x); + }, + + set: function(vec){ + this.x = vec.x; + this.y = vec.y; + return this; + } + +}; + +Vector.add = function(vec1, vec2){ + return vec1.clone().add(vec2.clone()); +}; + +Vector.sub = function(vec1, vec2){ + return vec1.clone().sub(vec2.clone()); +}; + +Vector.mult = function(vec, mult){ + return vec.clone().mult(mult); +}; + +Vector.div = function(vec, div){ + return vec.clone().div(div); +}; + +// Ripped from processing +Vector.random2D = function(){ + var angle = Math.random(0, 1) * Math.PI * 2; + return new Vector(Math.cos(angle), Math.sin(angle)); +}; + +Vector.coerce = function(obj){ + return new Vector(obj.x, obj.y); +}; + +global.Vector = Vector; + +})(this); diff --git a/website/source/javascripts/lib/dbg.js b/website/source/javascripts/lib/dbg.js new file mode 100644 index 0000000000..6df4f37625 --- /dev/null +++ b/website/source/javascripts/lib/dbg.js @@ -0,0 +1,60 @@ +/* + * + * name: dbg + * + * description: A bad ass little console utility, check the README for deets + * + * license: MIT-style license + * + * author: Amadeus Demarzi + * + * provides: window.dbg + * + */ + +(function(){ + + var global = this, + + // Get the real console or set to null for easy boolean checks + realConsole = global.console || null, + + // Backup / Disabled Lambda + fn = function(){}, + + // Supported console methods + methodNames = ['log', 'error', 'warn', 'info', 'count', 'debug', 'profileEnd', 'trace', 'dir', 'dirxml', 'assert', 'time', 'profile', 'timeEnd', 'group', 'groupEnd'], + + // Disabled Console + disabledConsole = { + + // Enables dbg, if it exists, otherwise it just provides disabled + enable: function(quiet){ + global.dbg = realConsole ? realConsole : disabledConsole; + }, + + // Disable dbg + disable: function(){ + global.dbg = disabledConsole; + } + + }, name, i; + + // Setup disabled console and provide fallbacks on the real console + for (i = 0; i < methodNames.length;i++){ + name = methodNames[i]; + disabledConsole[name] = fn; + if (realConsole && !realConsole[name]) + realConsole[name] = fn; + } + + // Add enable/disable methods + if (realConsole) { + realConsole.disable = disabledConsole.disable; + realConsole.enable = disabledConsole.enable; + } + + // Enable dbg + disabledConsole.enable(); + +}).call(this); diff --git a/website/source/layouts/_footer.erb b/website/source/layouts/_footer.erb index 75290181da..830791c164 100644 --- a/website/source/layouts/_footer.erb +++ b/website/source/layouts/_footer.erb @@ -19,14 +19,29 @@ + - - - - - + + + + + + + + + + + + + + + + + + + + + diff --git a/website/source/layouts/_header.erb b/website/source/layouts/_header.erb index 2d2f5c7d74..c69272659e 100644 --- a/website/source/layouts/_header.erb +++ b/website/source/layouts/_header.erb @@ -34,7 +34,7 @@ -"> +" class="page-<%= current_page.data.page_title ? "#{current_page.data.page_title} layout-#{current_page.data.layout} page-sub" : "home layout-#{current_page.data.layout}" %>">