2014-07-24 05:35:57 +02:00
|
|
|
(function(
|
|
|
|
Engine
|
|
|
|
){
|
|
|
|
|
|
|
|
var Init = {
|
|
|
|
|
|
|
|
start: function(){
|
|
|
|
var id = document.body.id.toLowerCase();
|
|
|
|
|
|
|
|
if (this.Pages[id]) {
|
|
|
|
this.Pages[id]();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2014-07-26 10:00:59 +02:00
|
|
|
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;
|
|
|
|
},
|
|
|
|
|
2014-07-24 05:35:57 +02:00
|
|
|
Pages: {
|
|
|
|
'page-home': function(){
|
|
|
|
var jumbotron = document.getElementById('jumbotron'),
|
2014-07-26 10:00:59 +02:00
|
|
|
content = document.getElementById('jumbotron-content'),
|
|
|
|
galaxy = document.getElementById('galaxy-bg'),
|
|
|
|
tagLine = document.getElementById('tag-line'),
|
2014-07-24 05:35:57 +02:00
|
|
|
canvas;
|
|
|
|
|
|
|
|
if (!jumbotron) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-07-26 10:00:59 +02:00
|
|
|
content.appendChild(
|
|
|
|
Init.generateAnimatedLogo()
|
|
|
|
);
|
|
|
|
|
2014-07-24 05:35:57 +02:00
|
|
|
canvas = document.createElement('canvas');
|
|
|
|
canvas.className = 'terraform-canvas';
|
|
|
|
|
|
|
|
jumbotron.appendChild(canvas);
|
2014-07-26 10:00:59 +02:00
|
|
|
window.engine = new Engine(canvas, galaxy, tagLine);
|
2014-07-24 05:35:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Init.start();
|
|
|
|
|
|
|
|
})(window.Engine);
|