41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
import AbstractView from "./abstracts/AbstractView.js";
|
|
import { lang } from "../index.js";
|
|
import { TicTacToe } from "../api/game/TicTacToeGame.js"
|
|
|
|
export default class extends AbstractView
|
|
{
|
|
constructor(params, titleKey)
|
|
{
|
|
super(params, lang.get('ticTacToeTitle'));
|
|
this.params = params;
|
|
this.titleKey = titleKey;
|
|
this.height = 660;
|
|
this.width = 660;
|
|
}
|
|
|
|
async postInit()
|
|
{
|
|
this.Morpion = new TicTacToe(this.height, this.width, 60, 60, document.getElementById("Morpion"));
|
|
this.Morpion.DrawSuperMorpion();
|
|
}
|
|
|
|
async leavePage()
|
|
{
|
|
|
|
}
|
|
|
|
setTitle()
|
|
{
|
|
document.title = lang.get(this.titleKey, this.titleKey);
|
|
}
|
|
|
|
async getHtml() {
|
|
return `
|
|
<link rel="stylesheet" href="/static/css/tictactoe.css">
|
|
<div id="canva">
|
|
<canvas id="Morpion" width="${this.width}" height="${this.height}"></canvas>
|
|
</div>
|
|
<h1>Work in progress bozo</h1>
|
|
<img src="https://cdn.discordapp.com/attachments/1089527100681240716/1219360784224616498/Snapinsta.app_424926392_1109913580191337_8974514051687331181_n_1080.jpg?ex=660b0539&is=65f89039&hm=25dbcab44e50ec8ca3019dab476293a1001c224c6b6312bd9e30fba1f72667b5&">`;
|
|
}
|
|
} |