Home.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227
  1. <template>
  2. <div class="app">
  3. <main-header></main-header>
  4. <div class="modal" :class="{ 'is-active': isRegisterActive }">
  5. <div class="modal-background"></div>
  6. <div class="modal-card">
  7. <header class="modal-card-head">
  8. <p class="modal-card-title">Register</p>
  9. <button class="delete" @click="toggleModal('register')"></button>
  10. </header>
  11. <section class="modal-card-body">
  12. <!-- validation to check if exists http://bulma.io/documentation/elements/form/ -->
  13. <label class="label">Email</label>
  14. <p class="control">
  15. <input class="input" type="text" placeholder="Email..." v-model="$parent.register.email">
  16. </p>
  17. <label class="label">Username</label>
  18. <p class="control">
  19. <input class="input" type="text" placeholder="Username..." v-model="$parent.register.username">
  20. </p>
  21. <label class="label">Password</label>
  22. <p class="control">
  23. <input class="input" type="password" placeholder="Password..." v-model="$parent.register.password">
  24. </p>
  25. <div class="g-recaptcha" data-sitekey="6Lfa-wYUAAAAANY6iVvWNEXohC38l1cZqHRole9T"></div>
  26. </section>
  27. <footer class="modal-card-foot">
  28. <a class="button is-primary" @click="submitModal('register')">Submit</a>
  29. </footer>
  30. </div>
  31. </div>
  32. <div class="modal" :class="{ 'is-active': isLoginActive }">
  33. <div class="modal-background"></div>
  34. <div class="modal-card">
  35. <header class="modal-card-head">
  36. <p class="modal-card-title">Login</p>
  37. <button class="delete" @click="toggleModal('login')"></button>
  38. </header>
  39. <section class="modal-card-body">
  40. <!-- validation to check if exists http://bulma.io/documentation/elements/form/ -->
  41. <label class="label">Email</label>
  42. <p class="control">
  43. <input class="input" type="text" placeholder="Email..." v-model="$parent.login.email">
  44. </p>
  45. <label class="label">Password</label>
  46. <p class="control">
  47. <input class="input" type="password" placeholder="Password..." v-model="$parent.login.password">
  48. </p>
  49. </section>
  50. <footer class="modal-card-foot">
  51. <a class="button is-primary" @click="submitModal('login')">Submit</a>
  52. </footer>
  53. </div>
  54. </div>
  55. <div class="group">
  56. <!--<div class="group-title">{{group.name}}</div>-->
  57. <div class="group-stations">
  58. <div class="stations-station" v-for="station in $parent.stations" v-link="{ path: '/station/' + station.id }">
  59. <img class="station-image" :src="station.playlist[station.currentSongIndex].thumbnail" />
  60. <div class="station-info">
  61. <div class="station-grid-left">
  62. <h3>{{ station.displayName }}</h3>
  63. <p>{{ station.description }}</p>
  64. </div>
  65. <div class="station-grid-right">
  66. <!--<div>{{ station.users }}&nbsp;&nbsp;<i class="fa fa-user" aria-hidden="true"></i></div>-->
  67. </div>
  68. </div>
  69. </div>
  70. </div>
  71. </div>
  72. <main-footer></main-footer>
  73. </div>
  74. </template>
  75. <script>
  76. import MainHeader from '../MainHeader.vue'
  77. import MainFooter from '../MainFooter.vue'
  78. export default {
  79. data() {
  80. return {
  81. isRegisterActive: false,
  82. isLoginActive: false
  83. }
  84. },
  85. methods: {
  86. toggleModal: function(type) {
  87. switch(type) {
  88. case 'register':
  89. this.isRegisterActive = !this.isRegisterActive;
  90. break;
  91. case 'login':
  92. this.isLoginActive = !this.isLoginActive;
  93. break;
  94. }
  95. },
  96. submitModal: function(type) {
  97. switch(type) {
  98. case 'register':
  99. this.$dispatch('register');
  100. this.toggleModal('register');
  101. break;
  102. case 'login':
  103. this.$dispatch('login');
  104. this.toggleModal('login');
  105. break;
  106. }
  107. }
  108. },
  109. components: { MainHeader, MainFooter }
  110. }
  111. </script>
  112. <style lang="sass">
  113. * { box-sizing: border-box; font-family: Roboto, sans-serif; }
  114. html {
  115. width: 100%;
  116. height: 100%;
  117. color: rgba(0, 0, 0, 0.87);
  118. body {
  119. width: 100%;
  120. height: 100%;
  121. margin: 0;
  122. padding: 0;
  123. }
  124. }
  125. @media only screen and (min-width: 1200px) {
  126. html {
  127. font-size: 15px;
  128. }
  129. }
  130. @media only screen and (min-width: 992px) {
  131. html {
  132. font-size: 14.5px;
  133. }
  134. }
  135. @media only screen and (min-width: 0) {
  136. html {
  137. font-size: 14px;
  138. }
  139. }
  140. .label {
  141. display: flex;
  142. }
  143. .g-recaptcha {
  144. display: flex;
  145. justify-content: center;
  146. margin-top: 20px;
  147. }
  148. .group {
  149. width: 100%;
  150. height: 448px;
  151. margin: 64px 0 0 0;
  152. .group-title {
  153. float: left;
  154. clear: none;
  155. width: 100%;
  156. height: 64px;
  157. line-height: 48px;
  158. text-align: center;
  159. font-size: 48px;
  160. }
  161. .group-stations {
  162. white-space: nowrap;
  163. text-align: center;
  164. overflow: hidden;
  165. float: left;
  166. clear: none;
  167. width: 100%;
  168. height: 400px;
  169. .stations-station {
  170. position: relative;
  171. top: 16px;
  172. display: inline-block;
  173. clear: none;
  174. width: 256px;
  175. height: 370px;
  176. margin: 0 16px 0 16px;
  177. box-shadow: 0 1px 6px 2px rgba(0, 0, 0, 0.25);
  178. cursor: pointer;
  179. .station-info {
  180. display: flex;
  181. flex-direction: row;
  182. align-items: center;
  183. }
  184. .station-image {
  185. width: 100%;
  186. height: 256px;
  187. }
  188. .station-grid-left {
  189. display: flex;
  190. flex-direction: column;
  191. width: 75%;
  192. text-align: left;
  193. padding-left: 10px;
  194. h3, p {
  195. margin: 0;
  196. white-space: normal;
  197. padding-top: 10px;
  198. }
  199. }
  200. .station-grid-right {
  201. display: flex;
  202. flex-direction: column;
  203. width: 25%;
  204. }
  205. }
  206. }
  207. }
  208. </style>