Styling
[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")
4f887105 16 #menuBar(@click="hideDrawer")
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
BA
43<script>
44// See https://stackoverflow.com/a/35417159
45import ContactForm from "@/components/ContactForm.vue";
46import Language from "@/components/Language.vue";
47import Settings from "@/components/Settings.vue";
c66a829b
BA
48import UpsertUser from "@/components/UpsertUser.vue";
49import { store } from "./store.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 },
9ca1e26b
BA
67// mounted: function() {
68// feather.replace();
69// },
4f887105
BA
70 methods: {
71 hideDrawer: function(e) {
72 if (e.target.innerText == "Forum")
73 return; //external link
74 e.preventDefault(); //TODO: why is this needed?
75 document.getElementsByClassName("drawer")[0].checked = false;
76 },
77 },
98db2082
BA
78};
79</script>
80
625022fd
BA
81<style lang="sass">
82#app
83 font-family: "Avenir", Helvetica, Arial, sans-serif
84 -webkit-font-smoothing: antialiased
85 -moz-osx-font-smoothing: grayscale
625022fd 86
85e5b5c1
BA
87.container
88 @media screen and (max-width: 767px)
89 padding: 0
90
fb54f098
BA
91.row > div
92 padding: 0
93
94.nopadding
95 padding: 0
96
85e5b5c1
BA
97header
98 width: 100%
99 display: flex
100 align-items: center
101 justify-content: center
102 margin: 0 auto
103 & > img
104 width: 30px
105 height: 30px
106
107.clickable
108 cursor: pointer
109
110nav
111 width: 100%
fb54f098 112 margin: 0
85e5b5c1
BA
113 padding: 0
114 & > #menuBar
115 width: 100%
116 padding: 0
117 & > #leftMenu
118 padding: 0
119 width: 50%
120 display: inline-flex
121 align-items: center
122 justify-content: flex-start
123 & > a
124 display: inline-block
125 color: #2c3e50
126 &.router-link-exact-active
127 color: #42b983
128 & > #rightMenu
129 padding: 0
130 width: 50%
131 display: inline-flex
132 align-items: center
133 justify-content: flex-end
134 & > div
135 display: inline-block
fb54f098
BA
136 &#flagContainer
137 display: inline-flex
85e5b5c1
BA
138 & > img
139 padding: 0
fb54f098
BA
140 width: 36px
141 height: 27px
85e5b5c1 142
430a2038
BA
143@media screen and (max-width: 767px)
144 nav
145 border: none
146
85e5b5c1
BA
147[type="checkbox"].drawer+*
148 right: -767px
149
4f887105
BA
150#menuBar
151 label.drawer-close
152 top: 50px
153
85e5b5c1 154footer
5701c228 155 border: 1px solid #ddd
85e5b5c1
BA
156 //background-color: #000033
157 font-size: 1rem
158 width: 100%
a6b9b86c
BA
159 padding-left: 0
160 padding-right: 0
85e5b5c1
BA
161 display: inline-flex
162 align-items: center
163 justify-content: center
050ae3b5
BA
164 & > .router-link-exact-active
165 color: #42b983 !important
166 text-decoration: none
92a523d1 167 & > .menuitem
85e5b5c1 168 display: inline-block
5157ce0b 169 margin: 0 10px
85e5b5c1
BA
170 &:link
171 color: #2c3e50
5701c228
BA
172 &:visited, &:hover
173 color: #2c3e50
85e5b5c1
BA
174 text-decoration: none
175 & > p
176 display: inline-block
5157ce0b 177 margin: 0 10px
430a2038
BA
178
179@media screen and (max-width: 767px)
180 footer
181 border: none
625022fd 182</style>