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): | |
cf2343ce | 11 | // Left: hall, variants, mygames, problems |
85e5b5c1 BA |
12 | // Right: usermenu, settings, flag |
13 | nav | |
14 | label.drawer-toggle(for="drawerControl") | |
15 | input#drawerControl.drawer(type="checkbox") | |
16 | #menuBar | |
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"] }} | |
25 | router-link(to="/problems") | |
26 | | {{ st.tr["Problems"] }} | |
27 | #rightMenu | |
28 | .clickable(onClick="doClick('modalUser')") | |
29 | | {{ !st.user.id ? "Login" : "Update" }} | |
30 | .clickable(onClick="doClick('modalSettings')") | |
31 | | {{ st.tr["Settings"] }} | |
fb54f098 | 32 | .clickable#flagContainer(onClick="doClick('modalLang')") |
85e5b5c1 BA |
33 | img(v-if="!!st.lang" |
34 | :src="require(`@/assets/images/flags/${st.lang}.svg`)") | |
fb54f098 | 35 | router-view |
ccd4a2b7 | 36 | .row |
85e5b5c1 BA |
37 | .col-sm-12.col-md-10.col-md-offset-1.col-lg-8.col-lg-offset-2 |
38 | footer | |
39 | a(href="https://github.com/yagu0/vchess") {{ st.tr["Source code"] }} | |
ccd4a2b7 | 40 | p.clickable(onClick="doClick('modalContact')") |
c66a829b | 41 | | {{ st.tr["Contact form"] }} |
8d61fc4a BA |
42 | //my-game(:game-ref="gameRef" :mode="mode" :settings="settings" @game-over="archiveGame") |
43 | //// TODO: add only the necessary icons to mini-css custom build | |
44 | //script(src="//unpkg.com/feather-icons") | |
625022fd BA |
45 | </template> |
46 | ||
98db2082 BA |
47 | <script> |
48 | // See https://stackoverflow.com/a/35417159 | |
49 | import ContactForm from "@/components/ContactForm.vue"; | |
50 | import Language from "@/components/Language.vue"; | |
51 | import Settings from "@/components/Settings.vue"; | |
c66a829b BA |
52 | import UpsertUser from "@/components/UpsertUser.vue"; |
53 | import { store } from "./store.js"; | |
98db2082 | 54 | export default { |
98db2082 BA |
55 | components: { |
56 | ContactForm, | |
57 | Language, | |
58 | Settings, | |
c66a829b BA |
59 | UpsertUser, |
60 | }, | |
61 | data: function() { | |
62 | return { | |
63 | st: store.state, | |
64 | }; | |
98db2082 | 65 | }, |
24340cae BA |
66 | // // TODO: $route: ... |
67 | // gameRef: function() { | |
68 | // this.loadGame(); | |
69 | // }, | |
98db2082 BA |
70 | }; |
71 | </script> | |
72 | ||
625022fd BA |
73 | <style lang="sass"> |
74 | #app | |
75 | font-family: "Avenir", Helvetica, Arial, sans-serif | |
76 | -webkit-font-smoothing: antialiased | |
77 | -moz-osx-font-smoothing: grayscale | |
625022fd | 78 | |
85e5b5c1 BA |
79 | .container |
80 | @media screen and (max-width: 767px) | |
81 | padding: 0 | |
82 | ||
fb54f098 BA |
83 | .row > div |
84 | padding: 0 | |
85 | ||
86 | .nopadding | |
87 | padding: 0 | |
88 | ||
85e5b5c1 BA |
89 | header |
90 | width: 100% | |
91 | display: flex | |
92 | align-items: center | |
93 | justify-content: center | |
94 | margin: 0 auto | |
95 | & > img | |
96 | width: 30px | |
97 | height: 30px | |
98 | ||
99 | .clickable | |
100 | cursor: pointer | |
101 | ||
102 | nav | |
103 | width: 100% | |
fb54f098 | 104 | margin: 0 |
85e5b5c1 BA |
105 | padding: 0 |
106 | & > #menuBar | |
107 | width: 100% | |
108 | padding: 0 | |
109 | & > #leftMenu | |
110 | padding: 0 | |
111 | width: 50% | |
112 | display: inline-flex | |
113 | align-items: center | |
114 | justify-content: flex-start | |
115 | & > a | |
116 | display: inline-block | |
117 | color: #2c3e50 | |
118 | &.router-link-exact-active | |
119 | color: #42b983 | |
120 | & > #rightMenu | |
121 | padding: 0 | |
122 | width: 50% | |
123 | display: inline-flex | |
124 | align-items: center | |
125 | justify-content: flex-end | |
126 | & > div | |
127 | display: inline-block | |
fb54f098 BA |
128 | &#flagContainer |
129 | display: inline-flex | |
85e5b5c1 BA |
130 | & > img |
131 | padding: 0 | |
fb54f098 BA |
132 | width: 36px |
133 | height: 27px | |
85e5b5c1 BA |
134 | |
135 | // TODO: drawer, until 600px wide OK (seemingly) | |
136 | // After, zone where left and right just go on top of another | |
137 | // Then, on narrow screen put everything on one line | |
138 | [type="checkbox"].drawer+* | |
139 | right: -767px | |
140 | ||
141 | footer | |
142 | //background-color: #000033 | |
143 | font-size: 1rem | |
144 | width: 100% | |
a6b9b86c BA |
145 | padding-left: 0 |
146 | padding-right: 0 | |
85e5b5c1 BA |
147 | display: inline-flex |
148 | align-items: center | |
149 | justify-content: center | |
150 | & > a | |
151 | display: inline-block | |
152 | margin: 0 10px 0 0 | |
153 | &:link | |
154 | color: #2c3e50 | |
155 | &:hover | |
156 | text-decoration: none | |
157 | & > p | |
158 | display: inline-block | |
159 | margin: 0 0 0 10px | |
625022fd | 160 | </style> |