Files
2048/js/application.js
T
Gabriele Cirulli 487ad74026 Migrate to gtag.js
2018-11-04 11:12:06 +01:00

23 lines
805 B
JavaScript

// Wait till the browser is ready to render the game (avoids glitches)
window.requestAnimationFrame(function () {
new GameManager(4, KeyboardInputManager, HTMLActuator, LocalStorageManager);
// TODO: This code is in need of a refactor (along with the rest)
var storage = new LocalStorageManager;
var noticeClose = document.querySelector(".notice-close-button");
var notice = document.querySelector(".app-notice");
if (storage.getNoticeClosed()) {
notice.parentNode.removeChild(notice);
} else {
noticeClose.addEventListener("click", function () {
notice.parentNode.removeChild(notice);
storage.setNoticeClosed(true);
if (typeof gtag !== undefined){
gtag("event", "closed", {
event_category: "notice",
});
}
});
}
});