X-Git-Url: https://git.auder.net/?a=blobdiff_plain;f=variants%2FHex%2Fclass.js;h=507b42daa302ac4845b209a1e835d84e71365ce5;hb=6b9320bb6e42ece7694df32f85aab4d2989f6a13;hp=db60da74843a76b47bfea0a6890592ad79236efe;hpb=fcede3ef85cbb36a05220033cdd318af68e0084c;p=xogo.git diff --git a/variants/Hex/class.js b/variants/Hex/class.js index db60da7..507b42d 100644 --- a/variants/Hex/class.js +++ b/variants/Hex/class.js @@ -32,10 +32,12 @@ export default class HexRules extends ChessRules { get hasReserve() { return false; } - get noAnimate() { return true; } + get clickOnly() { + return true; + } doClick(coords) { if ( @@ -161,27 +163,6 @@ export default class HexRules extends ChessRules { } } - initMouseEvents() { - const mousedown = (e) => { - if (e.touches && e.touches.length > 1) - e.preventDefault(); - const cd = this.idToCoords(e.target.id); - if (cd) { - const move = this.doClick(cd); - if (move) - this.playPlusVisual(move); - } - }; - - if ('onmousedown' in window) { - document.addEventListener("mousedown", mousedown); - document.addEventListener("wheel", - (e) => this.rescale(e.deltaY < 0 ? "up" : "down")); - } - if ('ontouchstart' in window) - document.addEventListener("touchstart", mousedown, {passive: false}); - } - get size() { const baseRatio = 1.6191907514450865; //2801.2 / 1730, "widescreen" const rotate = window.innerWidth < window.innerHeight; //"vertical screen"