2020-07-31 23:12:16 +02:00
|
|
|
// @ts-ignore
|
2021-04-28 13:51:53 +02:00
|
|
|
const {$, doAfterLoad, footer, header, nav} = window.fwdekker;
|
2020-07-31 23:12:16 +02:00
|
|
|
import {waitForForkAwesome} from "./Common";
|
2020-08-25 16:36:06 +02:00
|
|
|
import {BasicIconFont, ForkAwesomeFont} from "./Display";
|
2020-09-02 17:27:37 +02:00
|
|
|
import {Game} from "./Game";
|
|
|
|
import {Preferences} from "./Preferences";
|
2020-07-31 23:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
doAfterLoad(() => {
|
|
|
|
// Initialize template
|
|
|
|
$("#nav").appendChild(nav("/Tools/Minesweeper/"));
|
2020-08-01 01:38:08 +02:00
|
|
|
$("#header").appendChild(header({title: "Minesweeper"}));
|
2020-07-31 23:12:16 +02:00
|
|
|
$("#footer").appendChild(footer({
|
|
|
|
vcsURL: "https://git.fwdekker.com/FWDekker/minesweeper/",
|
|
|
|
version: "v%%VERSION_NUMBER%%"
|
|
|
|
}));
|
2021-04-28 13:51:53 +02:00
|
|
|
$("main").classList.remove("hidden");
|
2020-07-31 23:12:16 +02:00
|
|
|
|
|
|
|
|
|
|
|
// Start game
|
2020-08-25 16:36:06 +02:00
|
|
|
const preferences = new Preferences();
|
2020-08-10 19:56:28 +02:00
|
|
|
waitForForkAwesome(
|
2020-08-25 16:36:06 +02:00
|
|
|
() => {
|
|
|
|
preferences.font = new ForkAwesomeFont();
|
|
|
|
new Game(preferences);
|
|
|
|
},
|
2020-08-10 19:56:28 +02:00
|
|
|
() => {
|
|
|
|
alert("External font could not be loaded. Using fallback font. Is a browser extension blocking fonts?");
|
2020-08-25 16:36:06 +02:00
|
|
|
preferences.font = new BasicIconFont();
|
|
|
|
new Game(preferences);
|
2020-08-10 19:56:28 +02:00
|
|
|
},
|
|
|
|
3000
|
|
|
|
);
|
2020-07-31 23:12:16 +02:00
|
|
|
});
|