FANDOM


//
var fewNew = few == undefined;
var few = few || {};
 
few.DRAWING = Object.freeze({ NONE:0, TWOTWO:1, FOURFOUR:2 });
 
few.init = function(){
	few.canvas = document.getElementById('content-canvas');
	few.context = few.canvas.getContext('2d');
	few.WIDTH = few.canvas.width;
	few.HEIGHT = few.canvas.height;
	few.drawing = few.DRAWING.NONE;
};
 
 
few.drawLine = function(context, p1, p2, colour)
{
	var colour = colour != undefined ? colour : "#000";
	context.beginPath();
	context.moveTo(p1.x, p1.y);
	context.lineTo(p2.x, p2.y);
	context.closePath();
 
	/*context.lineWidth = 1;*/
	context.strokeStyle = colour;
	context.stroke();
};
 
few.draw1 = function(){
	// Vertical
	few.drawLine(few.context, {x:few.WIDTH/2, y:0}, {x:few.WIDTH/2, y:few.HEIGHT});
 
	// Horizontal
	few.drawLine(few.context, {x:0, y:few.HEIGHT/2}, {x:few.WIDTH, y:few.HEIGHT/2});
 
	few.requestId = window.requestAnimationFrame(few.draw1);
};
 
few.draw2 = function(){
	// Vertical
	few.drawLine(few.context, {x:few.WIDTH/4*1, y:0}, {x:few.WIDTH/4*1, y:few.HEIGHT});
	few.drawLine(few.context, {x:few.WIDTH/4*2, y:0}, {x:few.WIDTH/4*2, y:few.HEIGHT});
	few.drawLine(few.context, {x:few.WIDTH/4*3, y:0}, {x:few.WIDTH/4*3, y:few.HEIGHT});
 
	// Horizontal
	few.drawLine(few.context, {x:0, y:few.HEIGHT/4*1}, {x:few.WIDTH, y:few.HEIGHT/4*1});
	few.drawLine(few.context, {x:0, y:few.HEIGHT/4*2}, {x:few.WIDTH, y:few.HEIGHT/4*2});
	few.drawLine(few.context, {x:0, y:few.HEIGHT/4*3}, {x:few.WIDTH, y:few.HEIGHT/4*3});
 
	few.requestId = window.requestAnimationFrame(few.draw2);
};
 
few.update = function() {
	if(few.drawing == few.DRAWING.NONE) {
		few.drawing = few.DRAWING.TWOTWO;
		few.draw1();
	}
	else if(few.drawing == few.DRAWING.TWOTWO) {
		few.drawing = few.DRAWING.FOURFOUR;
		window.cancelAnimationFrame(few.requestId); few.requestId = undefined;
		few.draw2();
	}
	else if(few.drawing == few.DRAWING.FOURFOUR) {
		few.drawing = few.DRAWING.NONE;
		window.cancelAnimationFrame(few.requestId); few.requestId = undefined;
	}
};
 
if(fewNew){ few.init(); }
few.update();
//

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.