Pass result to Hall after a game ends
[vchess.git] / client / src / App.vue
CommitLineData
625022fd 1<template lang="pug">
98db2082 2#app
98db2082 3 Language
c66a829b 4 Settings
98db2082 5 ContactForm
c66a829b 6 UpsertUser
98db2082 7 .container
98db2082 8 .row
85e5b5c1
BA
9 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
10 // Menu (top of page):
5157ce0b 11 // Left: hall, variants, mygames
85e5b5c1
BA
12 // Right: usermenu, settings, flag
13 nav
14 label.drawer-toggle(for="drawerControl")
15 input#drawerControl.drawer(type="checkbox")
9a3049f3 16 #menuBar(@click="hideDrawer($event)")
85e5b5c1
BA
17 label.drawer-close(for="drawerControl")
18 #leftMenu
19 router-link(to="/")
cf2343ce 20 | {{ st.tr["Hall"] }}
85e5b5c1
BA
21 router-link(to="/variants")
22 | {{ st.tr["Variants"] }}
23 router-link(to="/mygames")
24 | {{ st.tr["My games"] }}
85e5b5c1
BA
25 #rightMenu
26 .clickable(onClick="doClick('modalUser')")
3837d4f7 27 | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }}
85e5b5c1
BA
28 .clickable(onClick="doClick('modalSettings')")
29 | {{ st.tr["Settings"] }}
fb54f098 30 .clickable#flagContainer(onClick="doClick('modalLang')")
03608482 31 img(v-if="!!st.lang" :src="flagImage")
fb54f098 32 router-view
ccd4a2b7 33 .row
85e5b5c1
BA
34 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
35 footer
92a523d1 36 router-link.menuitem(to="/about") {{ st.tr["About"] }}
ccd4a2b7 37 p.clickable(onClick="doClick('modalContact')")
92a523d1 38 | {{ st.tr["Contact"] }}
5157ce0b
BA
39 a.menuitem(href="https://forum.vchess.club")
40 | {{ st.tr["Forum"] }}
625022fd
BA
41</template>
42
98db2082 43<script>
98db2082
BA
44import ContactForm from "@/components/ContactForm.vue";
45import Language from "@/components/Language.vue";
46import Settings from "@/components/Settings.vue";
c66a829b
BA
47import UpsertUser from "@/components/UpsertUser.vue";
48import { store } from "./store.js";
dcd68c41 49import { processModalClick } from "./utils/modalClick.js";
98db2082 50export default {
98db2082
BA
51 components: {
52 ContactForm,
53 Language,
54 Settings,
c66a829b
BA
55 UpsertUser,
56 },
57 data: function() {
58 return {
59 st: store.state,
60 };
98db2082 61 },
03608482
BA
62 computed: {
63 flagImage: function() {
64 return `/images/flags/${this.st.lang}.svg`;
65 },
66 },
dcd68c41
BA
67 mounted: function() {
68 let dialogs = document.querySelectorAll("div[role='dialog']");
69 dialogs.forEach(d => {
70 d.addEventListener("click", processModalClick);
71 });
72 },
4f887105
BA
73 methods: {
74 hideDrawer: function(e) {
75 if (e.target.innerText == "Forum")
76 return; //external link
77 e.preventDefault(); //TODO: why is this needed?
78 document.getElementsByClassName("drawer")[0].checked = false;
79 },
80 },
98db2082
BA
81};
82</script>
83
625022fd 84<style lang="sass">
bc093771
BA
85html, *
86 font-family: "Open Sans", Arial, sans-serif
87 --back-color: #f2f2f2
88 --a-link-color: black
89 --a-visited-color: black
dcd68c41
BA
90
91body
92 padding: 0
93 min-width: 320px
94
625022fd 95#app
625022fd
BA
96 -webkit-font-smoothing: antialiased
97 -moz-osx-font-smoothing: grayscale
625022fd 98
85e5b5c1 99.container
dcd68c41 100 overflow: hidden
85e5b5c1
BA
101 @media screen and (max-width: 767px)
102 padding: 0
103
fb54f098
BA
104.row > div
105 padding: 0
106
85e5b5c1
BA
107header
108 width: 100%
109 display: flex
110 align-items: center
111 justify-content: center
112 margin: 0 auto
113 & > img
114 width: 30px
115 height: 30px
116
117.clickable
118 cursor: pointer
119
dcd68c41
BA
120.text-center
121 text-align: center
122
dcd68c41
BA
123.clearer
124 clear: both
125
85e5b5c1
BA
126nav
127 width: 100%
fb54f098 128 margin: 0
85e5b5c1
BA
129 padding: 0
130 & > #menuBar
131 width: 100%
132 padding: 0
8c5f5390
BA
133 @media screen and (min-width: 768px)
134 & > #leftMenu
135 padding: 0
136 width: 50%
137 display: inline-flex
138 align-items: center
139 justify-content: flex-start
140 & > a
141 display: inline-block
142 color: #2c3e50
143 &.router-link-exact-active
144 color: #42b983
145 & > #rightMenu
146 padding: 0
147 width: 50%
148 display: inline-flex
149 align-items: center
150 justify-content: flex-end
151 & > div
152 display: inline-block
153 &#flagContainer
154 display: inline-flex
155 & > img
156 padding: 0
157 width: 36px
158 height: 27px
159 @media screen and (max-width: 767px)
160 & > #leftMenu
161 padding-bottom: 5px
162 & > a
163 color: #2c3e50
164 &.router-link-exact-active
165 color: #42b983
166 & > #rightMenu
167 padding-top: 5px
168 border-top: 1px solid darkgrey
169 & > div
170 &#flagContainer
171 display: inline-flex
172 & > img
173 padding: 0
174 width: 36px
175 height: 27px
85e5b5c1 176
430a2038
BA
177@media screen and (max-width: 767px)
178 nav
9936aac8 179 height: 32px
430a2038 180 border: none
57c8c2a6 181 & > label.drawer-toggle
9936aac8 182 font-size: 1.2rem
57c8c2a6 183 //padding: 0 0 0 10px
430a2038 184
85e5b5c1
BA
185[type="checkbox"].drawer+*
186 right: -767px
187
dcd68c41
BA
188@media screen and (max-width: 767px)
189 .button-group
190 flex-direction: row
191 button:not(:first-child)
192 border-left: 1px solid var(--button-group-border-color)
193 border-top: 0
194
85e5b5c1 195footer
5701c228 196 border: 1px solid #ddd
85e5b5c1
BA
197 //background-color: #000033
198 font-size: 1rem
199 width: 100%
a6b9b86c
BA
200 padding-left: 0
201 padding-right: 0
85e5b5c1
BA
202 display: inline-flex
203 align-items: center
204 justify-content: center
050ae3b5
BA
205 & > .router-link-exact-active
206 color: #42b983 !important
207 text-decoration: none
92a523d1 208 & > .menuitem
85e5b5c1 209 display: inline-block
5157ce0b 210 margin: 0 10px
85e5b5c1
BA
211 &:link
212 color: #2c3e50
5701c228
BA
213 &:visited, &:hover
214 color: #2c3e50
85e5b5c1
BA
215 text-decoration: none
216 & > p
217 display: inline-block
5157ce0b 218 margin: 0 10px
430a2038
BA
219
220@media screen and (max-width: 767px)
221 footer
222 border: none
625022fd 223</style>