loadMore button for my local games as well
[vchess.git] / client / src / App.vue
CommitLineData
625022fd 1<template lang="pug">
98db2082 2#app
c66a829b 3 Settings
98db2082 4 ContactForm
c66a829b 5 UpsertUser
98db2082 6 .container
98db2082 7 .row
85e5b5c1
BA
8 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
9 // Menu (top of page):
89021f18 10 // Left: hall, variants, problems, mygames
5b3dc10e 11 // Right: usermenu, settings
85e5b5c1
BA
12 nav
13 label.drawer-toggle(for="drawerControl")
14 input#drawerControl.drawer(type="checkbox")
9a3049f3 15 #menuBar(@click="hideDrawer($event)")
85e5b5c1
BA
16 label.drawer-close(for="drawerControl")
17 #leftMenu
18 router-link(to="/")
cf2343ce 19 | {{ st.tr["Hall"] }}
ae2c49bb
BA
20 router-link(to="/mygames")
21 | {{ st.tr["My games"] }}
85e5b5c1
BA
22 router-link(to="/variants")
23 | {{ st.tr["Variants"] }}
89021f18
BA
24 router-link(to="/problems")
25 | {{ st.tr["Problems"] }}
85e5b5c1 26 #rightMenu
910d631b 27 .clickable(onClick="window.doClick('modalUser')")
3837d4f7 28 | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }}
5b3dc10e
BA
29 #divSettings.clickable(onClick="window.doClick('modalSettings')")
30 span {{ st.tr["Settings"] }}
b9a5fe01 31 img(src="/images/icons/settings.svg")
fb54f098 32 router-view
604b951e
BA
33 .row
34 .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2
35 footer
36 router-link.menuitem(to="/about") {{ st.tr["About"] }}
d9a7a1e4
BA
37 router-link.menuitem#newsMenu(to="/news") {{ st.tr["News"] }}
38 a.menuitem(href="https://discord.gg/a9ZFKBe")
39 span Discord
40 img(src="/images/icons/discord.svg")
b0a0468a
BA
41 a.menuitem(href="https://github.com/yagu0/vchess")
42 span {{ st.tr["Code"] }}
43 img(src="/images/icons/github.svg")
910d631b 44 p.clickable(onClick="window.doClick('modalContact')")
604b951e 45 | {{ st.tr["Contact"] }}
625022fd
BA
46</template>
47
98db2082 48<script>
98db2082 49import ContactForm from "@/components/ContactForm.vue";
98db2082 50import Settings from "@/components/Settings.vue";
c66a829b 51import UpsertUser from "@/components/UpsertUser.vue";
42a92848 52import { store } from "@/store.js";
d9a7a1e4 53import { ajax } from "@/utils/ajax.js";
98db2082 54export default {
98db2082
BA
55 components: {
56 ContactForm,
98db2082 57 Settings,
6808d7a1 58 UpsertUser
c66a829b
BA
59 },
60 data: function() {
d9a7a1e4
BA
61 return { st: store.state };
62 },
63 mounted: function() {
64 ajax(
65 "/newsts",
66 "GET",
67 {
68 success: (res) => {
69 if (this.st.user.newsRead < res.timestamp)
70 document.getElementById("newsMenu").classList.add("somenews");
71 }
72 }
73 );
98db2082 74 },
4f887105
BA
75 methods: {
76 hideDrawer: function(e) {
4f887105
BA
77 e.preventDefault(); //TODO: why is this needed?
78 document.getElementsByClassName("drawer")[0].checked = false;
6808d7a1
BA
79 }
80 }
98db2082
BA
81};
82</script>
83
625022fd 84<style lang="sass">
bc093771
BA
85html, *
86 font-family: "Open Sans", Arial, sans-serif
b0a0468a
BA
87 --a-link-color: darkred
88 --a-visited-color: darkred
dcd68c41
BA
89
90body
91 padding: 0
92 min-width: 320px
83c6c2c9
BA
93 --fore-color: #1c1e10 //#2c3e50
94 //--back-color: #f2f2f2
95 background-image: radial-gradient(white, #e6e6ff) //lavender)
dcd68c41 96
625022fd 97#app
625022fd
BA
98 -webkit-font-smoothing: antialiased
99 -moz-osx-font-smoothing: grayscale
625022fd 100
85e5b5c1 101.container
604b951e
BA
102 // 45px is footer height
103 min-height: calc(100vh - 45px)
dcd68c41 104 overflow: hidden
bd76b456
BA
105 padding: 0
106 margin: 0
85e5b5c1 107
fb54f098
BA
108.row > div
109 padding: 0
110
85e5b5c1
BA
111header
112 width: 100%
113 display: flex
114 align-items: center
115 justify-content: center
116 margin: 0 auto
85e5b5c1
BA
117
118.clickable
119 cursor: pointer
120
dcd68c41
BA
121.text-center
122 text-align: center
123
a17ae317
BA
124.bold
125 font-weight: bold
126
dcd68c41
BA
127.clearer
128 clear: both
129
bd76b456
BA
130.button-group
131 margin: 0
132
133input[type="checkbox"]:focus
134 outline: 0
135
136input[type=checkbox]:checked:before
137 top: -5px;
138 height: 18px
139
140table
141 display: block
142 padding: 0
143 tr > td
144 cursor: pointer
145 th, td
146 padding: 5px
147
5b3dc10e
BA
148#divSettings
149 padding: 0 10px 0 0
150 height: 100%
151 & > span
152 vertical-align: middle
153 & > img
154 padding: 0
d81c26d1 155 height: 1.2em
5b3dc10e
BA
156 vertical-align: middle
157
bd76b456
BA
158@media screen and (max-width: 767px)
159 table
160 tr > th, td
161 font-size: 14px
162
85e5b5c1
BA
163nav
164 width: 100%
fb54f098 165 margin: 0
85e5b5c1
BA
166 padding: 0
167 & > #menuBar
168 width: 100%
169 padding: 0
8c5f5390
BA
170 @media screen and (min-width: 768px)
171 & > #leftMenu
172 padding: 0
173 width: 50%
174 display: inline-flex
175 align-items: center
176 justify-content: flex-start
177 & > a
178 display: inline-block
179 color: #2c3e50
180 &.router-link-exact-active
181 color: #42b983
182 & > #rightMenu
183 padding: 0
184 width: 50%
185 display: inline-flex
186 align-items: center
187 justify-content: flex-end
188 & > div
189 display: inline-block
8c5f5390
BA
190 @media screen and (max-width: 767px)
191 & > #leftMenu
bd76b456 192 margin-top: 42px
8c5f5390
BA
193 padding-bottom: 5px
194 & > a
195 color: #2c3e50
196 &.router-link-exact-active
197 color: #42b983
198 & > #rightMenu
199 padding-top: 5px
200 border-top: 1px solid darkgrey
85e5b5c1 201
430a2038
BA
202@media screen and (max-width: 767px)
203 nav
bd76b456 204 height: 42px
430a2038 205 border: none
57c8c2a6 206 & > label.drawer-toggle
bd76b456 207 cursor: pointer
89021f18 208 position: absolute
57eb158f
BA
209 top: 0
210 left: 5px
211 line-height: 42px
212 height: 42px
b5aa30b5 213 padding: 0
57eb158f
BA
214 & > label.drawer-toggle:before
215 font-size: 42px
c6913dbc
BA
216 & > #menuBar
217 z-index: 5000 //to hide currently selected piece if any
430a2038 218
85e5b5c1
BA
219[type="checkbox"].drawer+*
220 right: -767px
221
bd76b456 222[type=checkbox].drawer+* .drawer-close
b5aa30b5 223 top: 0
57eb158f 224 left: 5px
b5aa30b5 225 padding: 0
57eb158f
BA
226 height: 50px
227 width: 50px
228 line-height: 50px
bd76b456
BA
229
230[type=checkbox].drawer+* .drawer-close:before
231 font-size: 50px
232
dcd68c41
BA
233@media screen and (max-width: 767px)
234 .button-group
235 flex-direction: row
236 button:not(:first-child)
237 border-left: 1px solid var(--button-group-border-color)
238 border-top: 0
239
85e5b5c1 240footer
604b951e 241 height: 45px
5701c228 242 border: 1px solid #ddd
604b951e 243 box-sizing: border-box
85e5b5c1
BA
244 //background-color: #000033
245 font-size: 1rem
246 width: 100%
604b951e 247 padding: 0
85e5b5c1
BA
248 display: inline-flex
249 align-items: center
250 justify-content: center
050ae3b5
BA
251 & > .router-link-exact-active
252 color: #42b983 !important
253 text-decoration: none
92a523d1 254 & > .menuitem
604b951e 255 margin: 0 12px
b0a0468a
BA
256 display: inline-flex;
257 align-self: center;
85e5b5c1
BA
258 &:link
259 color: #2c3e50
5701c228
BA
260 &:visited, &:hover
261 color: #2c3e50
85e5b5c1 262 text-decoration: none
b0a0468a 263 & > img
afd71778 264 height: 1.2em
b0a0468a
BA
265 display: inline-block
266 margin-left: 5px
85e5b5c1
BA
267 & > p
268 display: inline-block
604b951e 269 margin: 0 12px
430a2038
BA
270
271@media screen and (max-width: 767px)
272 footer
273 border: none
89021f18 274
d9a7a1e4
BA
275@media screen and (max-width: 420px)
276 footer
f14572c4 277 height: 55px
d9a7a1e4 278 display: block
f14572c4 279 padding: 5px 0
d9a7a1e4
BA
280
281.menuitem.somenews
934f7f70 282 animation: blinkNews 1s infinite;
d9a7a1e4
BA
283 color: red
284 &:link, &:visited, &:hover
285 color: red
286
934f7f70
BA
287@keyframes blinkNews
288 0%, 49%
289 background-color: yellow
290 padding: 3px
291 50%, 100%
292 background-color: grey
293 padding: 3px
294
89021f18
BA
295// Styles for diagrams and board (partial).
296// TODO: where to put that ?
297
298.light-square-diag
299 background-color: #e5e5ca
300
301.dark-square-diag
302 background-color: #6f8f57
303
304div.board
305 float: left
306 height: 0
307 display: inline-block
308 position: relative
309
310div.board8
311 width: 12.5%
312 padding-bottom: 12.5%
313
314div.board10
315 width: 10%
316 padding-bottom: 10%
317
318div.board11
319 width: 9.09%
320 padding-bottom: 9.1%
321
322img.piece
323 width: 100%
324
325img.piece, img.mark-square
326 max-width: 100%
327 height: auto
328 display: block
329
330img.mark-square
331 opacity: 0.6
332 width: 76%
333 position: absolute
334 top: 12%
335 left: 12%
336 opacity: .7
337
338.in-shadow
339 filter: brightness(50%)
625022fd 340</style>