| 1 | <template lang="pug"> |
| 2 | #app |
| 3 | Language |
| 4 | Settings |
| 5 | ContactForm |
| 6 | UpsertUser |
| 7 | .container |
| 8 | .row |
| 9 | .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 |
| 10 | // Menu (top of page): |
| 11 | // Left: hall, variants, mygames |
| 12 | // Right: usermenu, settings, flag |
| 13 | nav |
| 14 | label.drawer-toggle(for="drawerControl") |
| 15 | input#drawerControl.drawer(type="checkbox") |
| 16 | #menuBar(@click="hideDrawer") |
| 17 | label.drawer-close(for="drawerControl") |
| 18 | #leftMenu |
| 19 | router-link(to="/") |
| 20 | | {{ st.tr["Hall"] }} |
| 21 | router-link(to="/variants") |
| 22 | | {{ st.tr["Variants"] }} |
| 23 | router-link(to="/mygames") |
| 24 | | {{ st.tr["My games"] }} |
| 25 | #rightMenu |
| 26 | .clickable(onClick="doClick('modalUser')") |
| 27 | | {{ st.user.id > 0 ? (st.user.name || "@nonymous") : "Login" }} |
| 28 | .clickable(onClick="doClick('modalSettings')") |
| 29 | | {{ st.tr["Settings"] }} |
| 30 | .clickable#flagContainer(onClick="doClick('modalLang')") |
| 31 | img(v-if="!!st.lang" :src="flagImage") |
| 32 | router-view |
| 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"] }} |
| 37 | p.clickable(onClick="doClick('modalContact')") |
| 38 | | {{ st.tr["Contact"] }} |
| 39 | a.menuitem(href="https://forum.vchess.club") |
| 40 | | {{ st.tr["Forum"] }} |
| 41 | </template> |
| 42 | |
| 43 | <script> |
| 44 | import ContactForm from "@/components/ContactForm.vue"; |
| 45 | import Language from "@/components/Language.vue"; |
| 46 | import Settings from "@/components/Settings.vue"; |
| 47 | import UpsertUser from "@/components/UpsertUser.vue"; |
| 48 | import { store } from "./store.js"; |
| 49 | import { processModalClick } from "./utils/modalClick.js"; |
| 50 | export default { |
| 51 | components: { |
| 52 | ContactForm, |
| 53 | Language, |
| 54 | Settings, |
| 55 | UpsertUser, |
| 56 | }, |
| 57 | data: function() { |
| 58 | return { |
| 59 | st: store.state, |
| 60 | }; |
| 61 | }, |
| 62 | computed: { |
| 63 | flagImage: function() { |
| 64 | return `/images/flags/${this.st.lang}.svg`; |
| 65 | }, |
| 66 | }, |
| 67 | mounted: function() { |
| 68 | let dialogs = document.querySelectorAll("div[role='dialog']"); |
| 69 | dialogs.forEach(d => { |
| 70 | d.addEventListener("click", processModalClick); |
| 71 | }); |
| 72 | }, |
| 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 | }, |
| 81 | }; |
| 82 | </script> |
| 83 | |
| 84 | <style lang="sass"> |
| 85 | html, * |
| 86 | font-family: "Open Sans", Arial, sans-serif |
| 87 | --back-color: #f2f2f2 |
| 88 | --a-link-color: black |
| 89 | --a-visited-color: black |
| 90 | |
| 91 | body |
| 92 | padding: 0 |
| 93 | min-width: 320px |
| 94 | |
| 95 | #app |
| 96 | -webkit-font-smoothing: antialiased |
| 97 | -moz-osx-font-smoothing: grayscale |
| 98 | |
| 99 | .container |
| 100 | overflow: hidden |
| 101 | @media screen and (max-width: 767px) |
| 102 | padding: 0 |
| 103 | |
| 104 | .row > div |
| 105 | padding: 0 |
| 106 | |
| 107 | .nopadding |
| 108 | padding: 0 |
| 109 | |
| 110 | header |
| 111 | width: 100% |
| 112 | display: flex |
| 113 | align-items: center |
| 114 | justify-content: center |
| 115 | margin: 0 auto |
| 116 | & > img |
| 117 | width: 30px |
| 118 | height: 30px |
| 119 | |
| 120 | .clickable |
| 121 | cursor: pointer |
| 122 | |
| 123 | .text-center |
| 124 | text-align: center |
| 125 | |
| 126 | .smallpad |
| 127 | padding: 5px |
| 128 | |
| 129 | .emphasis |
| 130 | font-style: italic |
| 131 | |
| 132 | .clearer |
| 133 | clear: both |
| 134 | |
| 135 | .smallfont |
| 136 | font-size: 0.8em |
| 137 | |
| 138 | .bigfont |
| 139 | font-size: 1.2em |
| 140 | |
| 141 | .bold |
| 142 | font-weight: bold |
| 143 | |
| 144 | nav |
| 145 | width: 100% |
| 146 | margin: 0 |
| 147 | padding: 0 |
| 148 | & > #menuBar |
| 149 | width: 100% |
| 150 | padding: 0 |
| 151 | @media screen and (min-width: 768px) |
| 152 | & > #leftMenu |
| 153 | padding: 0 |
| 154 | width: 50% |
| 155 | display: inline-flex |
| 156 | align-items: center |
| 157 | justify-content: flex-start |
| 158 | & > a |
| 159 | display: inline-block |
| 160 | color: #2c3e50 |
| 161 | &.router-link-exact-active |
| 162 | color: #42b983 |
| 163 | & > #rightMenu |
| 164 | padding: 0 |
| 165 | width: 50% |
| 166 | display: inline-flex |
| 167 | align-items: center |
| 168 | justify-content: flex-end |
| 169 | & > div |
| 170 | display: inline-block |
| 171 | &#flagContainer |
| 172 | display: inline-flex |
| 173 | & > img |
| 174 | padding: 0 |
| 175 | width: 36px |
| 176 | height: 27px |
| 177 | @media screen and (max-width: 767px) |
| 178 | & > #leftMenu |
| 179 | padding-bottom: 5px |
| 180 | & > a |
| 181 | color: #2c3e50 |
| 182 | &.router-link-exact-active |
| 183 | color: #42b983 |
| 184 | & > #rightMenu |
| 185 | padding-top: 5px |
| 186 | border-top: 1px solid darkgrey |
| 187 | & > div |
| 188 | &#flagContainer |
| 189 | display: inline-flex |
| 190 | & > img |
| 191 | padding: 0 |
| 192 | width: 36px |
| 193 | height: 27px |
| 194 | |
| 195 | @media screen and (max-width: 767px) |
| 196 | nav |
| 197 | height: 32px |
| 198 | border: none |
| 199 | & > label.drawer-toggle |
| 200 | font-size: 1.2rem |
| 201 | //padding: 0 0 0 10px |
| 202 | |
| 203 | [type="checkbox"].drawer+* |
| 204 | right: -767px |
| 205 | |
| 206 | @media screen and (max-width: 767px) |
| 207 | .button-group |
| 208 | flex-direction: row |
| 209 | button:not(:first-child) |
| 210 | border-left: 1px solid var(--button-group-border-color) |
| 211 | border-top: 0 |
| 212 | |
| 213 | footer |
| 214 | border: 1px solid #ddd |
| 215 | //background-color: #000033 |
| 216 | font-size: 1rem |
| 217 | width: 100% |
| 218 | padding-left: 0 |
| 219 | padding-right: 0 |
| 220 | display: inline-flex |
| 221 | align-items: center |
| 222 | justify-content: center |
| 223 | & > .router-link-exact-active |
| 224 | color: #42b983 !important |
| 225 | text-decoration: none |
| 226 | & > .menuitem |
| 227 | display: inline-block |
| 228 | margin: 0 10px |
| 229 | &:link |
| 230 | color: #2c3e50 |
| 231 | &:visited, &:hover |
| 232 | color: #2c3e50 |
| 233 | text-decoration: none |
| 234 | & > p |
| 235 | display: inline-block |
| 236 | margin: 0 10px |
| 237 | |
| 238 | @media screen and (max-width: 767px) |
| 239 | footer |
| 240 | border: none |
| 241 | |
| 242 | //#settings, #contactForm |
| 243 | // max-width: 767px |
| 244 | // @media screen and (max-width: 767px) |
| 245 | // max-width: 100vw |
| 246 | //[type="checkbox"].modal+div .card |
| 247 | // max-width: 767px |
| 248 | // max-height: 100vh |
| 249 | //[type="checkbox"].modal+div .card.small-modal |
| 250 | // max-width: 320px |
| 251 | //[type="checkbox"].modal+div .card.big-modal |
| 252 | // max-width: 90vw |
| 253 | </style> |