taiko-web/public/src/js/titlescreen.js

53 lines
1.3 KiB
JavaScript
Raw Normal View History

2015-07-17 10:22:46 +02:00
function Titlescreen(){
var _this = this;
$("body").css("font-family", "TnT");
this.positionning = function(){
var width = 0.70*$(window).width();
var logoW = (width>=654) ? 654 : width;
var logoH = logoW/2.18;
$("#logo-big-cont").width(logoW);
$("#logo-big-cont").height(logoH);
$("#logo-big-cont").css("left", $(window).width()/2-($("#logo-big-cont").width()/2));
$("#logo-big-cont").css("top", $(window).height()/2-($("#logo-big-cont").height()/2));
}
this.run = function(){
$(document).keypress(function(e){
if(e.keyCode==13 && $("#screen").find("#title-screen").html())
_this.goNext();
});
$("#screen").find("#title-screen").click(function(){
_this.goNext();
});
_this.positionning();
$("#screen").find("#title-screen").show();
$(window).resize(_this.positionning);
2018-09-11 00:17:13 +02:00
assets.sounds["title"].play();
2018-08-06 12:13:01 +02:00
2015-07-17 10:22:46 +02:00
}
this.goNext = function(){
2018-08-06 16:12:08 +02:00
assets.sounds["title"].pause();
assets.sounds["title"].currentTime = 0;
2018-09-11 00:17:13 +02:00
assets.sounds["don"].play();
2018-09-02 18:11:09 +02:00
if (localStorage.getItem('tutorial') !== 'true') {
new Tutorial();
} else {
new SongSelect();
};
2015-07-17 10:22:46 +02:00
}
$("#screen").load("/src/views/titlescreen.html", _this.run);
}