App.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. <template>
  2. <div id='app'>
  3. <modal-window v-model='loginSignupModalVisible'>
  4. <tab-view :tabs='["Sign up", "Login"]'>
  5. <template slot='first'>
  6. <p style='margin-top: 0;'>
  7. Sign up to create and post in threads.
  8. <br/>It only takes a few seconds
  9. </p>
  10. {{signup.username}}
  11. <fancy-input
  12. v-model='signup.username'
  13. placeholder='Username'
  14. width='100%'
  15. >
  16. </fancy-input>
  17. <fancy-input
  18. v-model='signup.password'
  19. placeholder='Password'
  20. type='password'
  21. width='100%'
  22. >
  23. </fancy-input>
  24. <fancy-input
  25. v-model='signup.confirmPassword'
  26. placeholder='Confirm password'
  27. type='password'
  28. width='100%'
  29. >
  30. </fancy-input>
  31. <button class='button'>
  32. Sign up
  33. </button>
  34. <button class='button' @click='cancel'>
  35. Cancel
  36. </button>
  37. </template>
  38. <template slot='second'>
  39. text 2<br/>
  40. text 2<br/>
  41. text 2<br/>
  42. text 2<br/>
  43. text 2<br/>
  44. text 2<br/>
  45. </template>
  46. </tab-view>
  47. </modal-window>
  48. <header class='header'>
  49. <div class='header__group'>
  50. <div class='logo'>{{meta.name}}</div>
  51. </div>
  52. <div class='header__group'>
  53. <div class='button button--green' @click='showLoginSignupModal("signup")'>
  54. Sign up
  55. </div>
  56. <div class='button' @click='showLoginSignupModal("login")'>
  57. Login
  58. </div>
  59. <div class='search' tabindex='0'>
  60. <input class='search__field' placeholder='Search this forum'>
  61. <button class='button button--borderless'><span class='fa fa-search'></span></button>
  62. </div>
  63. </div>
  64. </header>
  65. <router-view></router-view>
  66. </div>
  67. </template>
  68. <script>
  69. window.MODAL_TAB = 0;
  70. import ModalWindow from './components/ModalWindow'
  71. import TabView from './components/TabView'
  72. import FancyInput from './components/FancyInput'
  73. export default {
  74. name: 'app',
  75. components: {
  76. ModalWindow,
  77. TabView,
  78. FancyInput
  79. },
  80. data () {
  81. return {
  82. meta: {
  83. name: 'Forum'
  84. },
  85. signup: {
  86. username: '',
  87. password: '',
  88. confirmPassword: ''
  89. },
  90. loginSignupModalVisible: false
  91. }
  92. },
  93. methods: {
  94. showLoginSignupModal (tab) {
  95. //TODO: show different tab depending on button
  96. this.loginSignupModalVisible = true;
  97. },
  98. cancel () {
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang='scss'>
  104. @import url('https://fonts.googleapis.com/css?family=Lato:300,300i,400|Montserrat');
  105. @import './assets/scss/variables.scss';
  106. html, body {
  107. width: 100%;
  108. height: 100%;
  109. margin: 0;
  110. padding: 0;
  111. color: $color__text--primary;
  112. @include text;
  113. }
  114. * {
  115. box-sizing: border-box;
  116. }
  117. .header {
  118. width: 100%;
  119. padding: 1rem 2rem;
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-between;
  123. border-bottom: 0.125rem solid $color__gray--primary;
  124. @at-root #{&}__group {
  125. display: flex;
  126. > * { margin: 0 0.5rem; }
  127. > *:first-child { margin-left: 0; }
  128. > *:last-child { margin-right: 0; }
  129. }
  130. }
  131. .logo {
  132. @include text($font--role-emphasis, 2rem, normal);
  133. }
  134. .button {
  135. border: 0.125rem solid $color__gray--primary;
  136. display: inline-block;
  137. text-align: center;
  138. @include text($font--role-default, 1rem, 400);
  139. padding: 0.5rem;
  140. cursor: pointer;
  141. background-color: #fff;
  142. transition: background-color 0.2s, border-color 0.2s;
  143. outline: none;
  144. &:hover {
  145. background-color: $color__lightgray--primary;
  146. border-color: $color__gray--darker;
  147. }
  148. &:active {
  149. background-color: $color__lightgray--darker;
  150. border-color: $color__gray--darkest;
  151. }
  152. @at-root #{&}__icon {
  153. }
  154. @at-root #{&}--borderless {
  155. border: 0;
  156. }
  157. @at-root #{&}--orange {
  158. border-color: $color__orange--primary;
  159. &:hover { border-color: $color__orange--darker; }
  160. &:active { border-color: $color__orange--darkest; }
  161. }
  162. }
  163. .input {
  164. border: 0.125rem solid $color__gray--primary;
  165. @include text;
  166. padding: 0.25rem;
  167. outline: none;
  168. &:hover {
  169. border-color: $color__gray--darker;
  170. }
  171. &:focus {
  172. border-color: $color__gray--darkest;
  173. }
  174. }
  175. .search {
  176. border: 0.125rem solid $color__gray--primary;
  177. &:hover {
  178. border-color: $color__gray--darker;
  179. }
  180. &:focus {
  181. border-color: $color__gray--darkest;
  182. }
  183. @at-root #{&}__field {
  184. outline: none;
  185. height: 100%;
  186. padding: 0 0.5rem;
  187. border: 0;
  188. @include text;
  189. @include placeholder {
  190. @include text;
  191. }
  192. }
  193. }
  194. </style>