toggleVisible("newGameForm");
import(`/variants/${vname}/class.js`).then(module => {
window.V = module.default;
+ V.Aliases.forEach(e => window[e.key] = e.val);
prepareOptions();
});
}
const options = obj.options || {};
import(`/variants/${obj.vname}/class.js`).then(module => {
window.V = module.default;
+ V.Aliases.forEach(e => window[e.key] = e.val);
// Load CSS. Avoid loading twice the same stylesheet:
const allIds = [].slice.call($.styleSheets).map(s => s.id);
const newId = obj.vname + "_css";
// NOTE: ChessRules is aliased as window.C, and variants as window.V
export default class ChessRules {
+ static get Aliases() {
+ return [{'C': ChessRules}];
+ }
+
/////////////////////////
// VARIANT SPECIFICATIONS
// Fen string fully describes the game state
constructor(o) {
- window.C = ChessRules; //easier alias
-
this.options = o.options;
this.playerColor = o.color;
this.afterPlay = o.afterPlay;
button.block-btn {
display: block;
background-color: #01786F;
- margin: 0 auto 20px auto;
+ margin: 0 auto 20px auto; /*TODO: margin-bottom 30px ? */
font-size: 2rem;
padding: 15px 32px;
}