2018-03-27 17:39:08 +00:00
|
|
|
window.onload = function(){
|
|
|
|
|
2018-04-24 18:12:38 +00:00
|
|
|
// Start Preloading!
|
|
|
|
publish("prepreload");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
subscribe("prepreload/done", function(){
|
|
|
|
|
|
|
|
// Bye Pre-Preloader!
|
|
|
|
var pre_preloader = $("#pre_preloader");
|
|
|
|
pre_preloader.parentNode.removeChild(pre_preloader);
|
|
|
|
|
2018-03-27 17:39:08 +00:00
|
|
|
// Setting up the main stuff
|
|
|
|
window.slideshow = new Slideshow();
|
|
|
|
window.pencil = new Pencil();
|
2018-04-04 15:57:35 +00:00
|
|
|
window.navigation = new Navigation();
|
2018-03-27 17:39:08 +00:00
|
|
|
|
|
|
|
// Initializing the Mouse
|
|
|
|
Mouse.init(document.body);
|
|
|
|
|
2018-03-27 19:20:22 +00:00
|
|
|
// Animation loop IS update loop for now, whatever
|
2018-03-27 17:39:08 +00:00
|
|
|
function update(){
|
2018-03-27 19:20:22 +00:00
|
|
|
|
|
|
|
// Update
|
2018-03-27 17:39:08 +00:00
|
|
|
slideshow.update();
|
|
|
|
pencil.update();
|
2018-03-27 19:20:22 +00:00
|
|
|
Mouse.update();
|
|
|
|
|
|
|
|
// Draw
|
2018-03-28 17:12:05 +00:00
|
|
|
slideshow.draw();
|
2018-03-27 19:20:22 +00:00
|
|
|
pencil.draw();
|
2018-04-02 17:43:20 +00:00
|
|
|
|
|
|
|
// Update
|
|
|
|
publish("update");
|
2018-03-27 19:20:22 +00:00
|
|
|
|
2018-03-27 17:39:08 +00:00
|
|
|
window.requestAnimationFrame(update);
|
2018-03-27 19:20:22 +00:00
|
|
|
|
2018-03-27 17:39:08 +00:00
|
|
|
}
|
|
|
|
window.requestAnimationFrame(update);
|
|
|
|
|
2018-04-24 18:12:38 +00:00
|
|
|
// Go to THE SPLASH
|
2018-04-27 12:57:59 +00:00
|
|
|
slideshow.gotoChapter("Preloader");
|
2018-04-26 14:15:00 +00:00
|
|
|
|
|
|
|
// HACK - MOBILE IS HORRIBLE
|
|
|
|
$all("a").forEach(function(a){
|
|
|
|
a.ontouchstart = function(event){
|
|
|
|
event.stopPropagation();
|
|
|
|
}; // so you CAN click links
|
|
|
|
});
|
2018-03-27 17:39:08 +00:00
|
|
|
|
2018-04-24 18:12:38 +00:00
|
|
|
});
|
2018-04-16 15:44:14 +00:00
|
|
|
|
|
|
|
subscribe("START", function(){
|
|
|
|
|
|
|
|
// Music
|
2018-04-18 14:51:44 +00:00
|
|
|
SOUNDS.bg_music.volume(0.5);
|
|
|
|
SOUNDS.bg_music.loop(true);
|
2018-04-16 19:51:08 +00:00
|
|
|
SOUNDS.bg_music.play();
|
2018-04-16 15:44:14 +00:00
|
|
|
|
2018-04-23 17:53:36 +00:00
|
|
|
// Hide translations, show navigation
|
|
|
|
$("#translations").style.display = "none";
|
2018-04-18 21:00:04 +00:00
|
|
|
$("#navigation").style.display = "block";
|
|
|
|
|
|
|
|
// Show Skip Button
|
2018-04-24 18:12:38 +00:00
|
|
|
var skippy = $("#skip");
|
|
|
|
skippy.style.display = "block";
|
|
|
|
skippy.onclick = function(){
|
2018-04-20 18:47:58 +00:00
|
|
|
publish("sound/button");
|
2018-04-18 21:00:04 +00:00
|
|
|
slideshow.next();
|
|
|
|
};
|
2018-04-24 18:12:38 +00:00
|
|
|
_stopPropButton(skippy);
|
2018-04-16 15:44:14 +00:00
|
|
|
|
|
|
|
// Introduction
|
|
|
|
slideshow.next();
|
|
|
|
|
|
|
|
});
|