Smaller Discord invitation size
[vchess.git] / client / src / main.js
1 import Vue from "vue";
2 import App from "./App.vue";
3 import router from "./router";
4 import { store } from "./store";
5
6 Vue.config.productionTip = false;
7
8 new 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");