Commit | Line | Data |
---|---|---|
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): | |
afd3240d | 11 | // Left: hall, variants, mygames, forum (ext. link) |
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"] }} | |
4f887105 | 25 | a(href="https://forum.vchess.club") |
afd3240d | 26 | | {{ st.tr["Forum"] }} |
85e5b5c1 BA |
27 | #rightMenu |
28 | .clickable(onClick="doClick('modalUser')") | |
1aeed627 | 29 | | {{ st.user.id > 0 ? "Update" : "Login" }} |
85e5b5c1 BA |
30 | .clickable(onClick="doClick('modalSettings')") |
31 | | {{ st.tr["Settings"] }} | |
fb54f098 | 32 | .clickable#flagContainer(onClick="doClick('modalLang')") |
03608482 | 33 | img(v-if="!!st.lang" :src="flagImage") |
fb54f098 | 34 | router-view |
ccd4a2b7 | 35 | .row |
85e5b5c1 BA |
36 | .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 |
37 | footer | |
92a523d1 | 38 | router-link.menuitem(to="/about") {{ st.tr["About"] }} |
ccd4a2b7 | 39 | p.clickable(onClick="doClick('modalContact')") |
92a523d1 | 40 | | {{ st.tr["Contact"] }} |
625022fd BA |
41 | </template> |
42 | ||
98db2082 BA |
43 | <script> |
44 | // See https://stackoverflow.com/a/35417159 | |
45 | import ContactForm from "@/components/ContactForm.vue"; | |
46 | import Language from "@/components/Language.vue"; | |
47 | import Settings from "@/components/Settings.vue"; | |
c66a829b BA |
48 | import UpsertUser from "@/components/UpsertUser.vue"; |
49 | import { store } from "./store.js"; | |
98db2082 | 50 | export 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 |
97 | header |
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 | ||
110 | nav | |
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 | |
85e5b5c1 BA |
143 | [type="checkbox"].drawer+* |
144 | right: -767px | |
145 | ||
4f887105 BA |
146 | #menuBar |
147 | label.drawer-close | |
148 | top: 50px | |
149 | ||
85e5b5c1 | 150 | footer |
5701c228 | 151 | border: 1px solid #ddd |
85e5b5c1 BA |
152 | //background-color: #000033 |
153 | font-size: 1rem | |
154 | width: 100% | |
a6b9b86c BA |
155 | padding-left: 0 |
156 | padding-right: 0 | |
85e5b5c1 BA |
157 | display: inline-flex |
158 | align-items: center | |
159 | justify-content: center | |
92a523d1 | 160 | & > .menuitem |
85e5b5c1 BA |
161 | display: inline-block |
162 | margin: 0 10px 0 0 | |
163 | &:link | |
164 | color: #2c3e50 | |
5701c228 BA |
165 | &:visited, &:hover |
166 | color: #2c3e50 | |
85e5b5c1 BA |
167 | text-decoration: none |
168 | & > p | |
169 | display: inline-block | |
170 | margin: 0 0 0 10px | |
625022fd | 171 | </style> |