This repository has been archived on 2023-05-26. You can view files and clone it, but cannot push or open issues or pull requests.
web/2048_fichiers/application.js

19 lines
724 B
JavaScript
Executable File

// 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);
ga("send", "event", "notice", "closed");
});
}
});