Better Ball rules. Buggish but almost OK Synchrone variant
[vchess.git] / client / src / main.js
... / ...
CommitLineData
1import Vue from "vue";
2import App from "./App.vue";
3import router from "./router";
4import { store } from "./store";
5
6Vue.config.productionTip = false;
7
8new Vue({
9 router,
10 render: function(h) {
11 return h(App);
12 },
13 created: function() {
14 // Several interactions on clicks on elements:
15 window.doClick = elemId => {
16 document.getElementById(elemId).click();
17 };
18 // Esc key can close modals:
19 document.addEventListener("keydown", e => {
20 if (e.code === "Escape") {
21 let modalBoxes = document.querySelectorAll("[id^='modal']");
22 modalBoxes.forEach(m => {
23 if (
24 m.checked &&
25 !["modalAccept","modalConfirm"].includes(m.id)
26 ) {
27 m.checked = false;
28 }
29 });
30 }
31 });
32 store.initialize();
33 }
34}).$mount("#app");