2014-07-24 05:35:57 +02:00
|
|
|
(function(
|
|
|
|
Engine
|
|
|
|
){
|
|
|
|
|
2014-07-28 03:01:48 +02:00
|
|
|
// Quick and dirty IE detection
|
2014-07-28 00:08:24 +02:00
|
|
|
var isIE = (function(){
|
2014-07-28 03:01:48 +02:00
|
|
|
if (window.navigator.userAgent.match('Trident')) {
|
|
|
|
return true;
|
|
|
|
} else {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
})();
|
2014-07-28 00:08:24 +02:00
|
|
|
|
|
|
|
// isIE = true;
|
|
|
|
|
2014-07-24 05:35:57 +02:00
|
|
|
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-28 00:08:24 +02:00
|
|
|
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);
|
2014-07-28 04:54:42 +02:00
|
|
|
new Engine(canvas, galaxy, tagLine);
|
2014-07-28 00:08:24 +02:00
|
|
|
},
|
|
|
|
|
2014-07-24 05:35:57 +02:00
|
|
|
Pages: {
|
|
|
|
'page-home': function(){
|
2014-07-28 00:08:24 +02:00
|
|
|
var jumbotron;
|
|
|
|
if (isIE) {
|
|
|
|
jumbotron = document.getElementById('jumbotron');
|
|
|
|
jumbotron.className += ' static';
|
2014-07-24 05:35:57 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2014-07-28 00:08:24 +02:00
|
|
|
Init.initializeEngine();
|
2014-07-24 05:35:57 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
Init.start();
|
|
|
|
|
|
|
|
})(window.Engine);
|