Home.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. <template>
  2. <div class="app">
  3. <main-header></main-header>
  4. <div class="group" v-if="stations.official.length">
  5. <div class="group-title">Official Stations</div>
  6. <div class="group-stations">
  7. <div class="stations-station" v-for="station in stations.official" v-link="{ path: '/official/' + station._id }" @click="this.$dispatch('joinStation', station._id)">
  8. <img class="station-image" :src="station.playlist[station.currentSongIndex].thumbnail" />
  9. <div class="station-info">
  10. <div class="station-grid-left">
  11. <h3>{{ station.displayName }}</h3>
  12. <p>{{ station.description }}</p>
  13. </div>
  14. <div class="station-grid-right">
  15. <div>{{ station.userCount }}&nbsp;&nbsp;<i class="material-icons">perm_identity</i></div>
  16. </div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. <div class="group" v-if="stations.community.length">
  22. <div class="group-title">Community Stations</div>
  23. <div class="group-stations">
  24. <div class="stations-station" v-for="station in stations.community" v-link="{ path: '/community/' + station._id }" @click="this.$dispatch('joinStation', station._id)">
  25. <img class="station-image" :src="station.playlist[station.currentSongIndex].thumbnail" />
  26. <div class="station-info">
  27. <div class="station-grid-left">
  28. <h3>{{ station.displayName }}</h3>
  29. <p>{{ station.description }}</p>
  30. </div>
  31. <div class="station-grid-right">
  32. <div>{{ station.userCount }}&nbsp;&nbsp;<i class="material-icons">perm_identity</i></div>
  33. </div>
  34. </div>
  35. </div>
  36. </div>
  37. </div>
  38. <main-footer></main-footer>
  39. </div>
  40. </template>
  41. <script>
  42. import MainHeader from '../MainHeader.vue';
  43. import MainFooter from '../MainFooter.vue';
  44. export default {
  45. data() {
  46. return {
  47. isRegisterActive: false,
  48. isLoginActive: false,
  49. recaptcha: {
  50. key: ''
  51. },
  52. stations: {
  53. official: [],
  54. community: []
  55. }
  56. }
  57. },
  58. ready() {
  59. let _this = this;
  60. let socketInterval = setInterval(() => {
  61. if (!!_this.$parent.socket) {
  62. _this.socket = _this.$parent.socket;
  63. _this.socket.emit("stations.index", data => {
  64. if (data.status === "success") data.stations.forEach(station => {
  65. if (station.type == 'official') _this.stations.official.push(station);
  66. else _this.stations.community.push(station);
  67. });
  68. });
  69. _this.socket.emit("");
  70. _this.socket.on("");
  71. clearInterval(socketInterval);
  72. }
  73. }, 100);
  74. },
  75. components: { MainHeader, MainFooter }
  76. }
  77. </script>
  78. <style lang="scss">
  79. @import 'theme.scss';
  80. * { box-sizing: border-box; }
  81. html {
  82. width: 100%;
  83. height: 100%;
  84. color: rgba(0, 0, 0, 0.87);
  85. body {
  86. width: 100%;
  87. height: 100%;
  88. margin: 0;
  89. padding: 0;
  90. }
  91. }
  92. @media only screen and (min-width: 1200px) {
  93. html {
  94. font-size: 15px;
  95. }
  96. }
  97. @media only screen and (min-width: 992px) {
  98. html {
  99. font-size: 14.5px;
  100. }
  101. }
  102. @media only screen and (min-width: 0) {
  103. html {
  104. font-size: 14px;
  105. }
  106. }
  107. .label {
  108. display: flex;
  109. }
  110. .g-recaptcha {
  111. display: flex;
  112. justify-content: center;
  113. margin-top: 20px;
  114. }
  115. .group {
  116. width: 100%;
  117. height: 448px;
  118. margin: 64px 0 0 0;
  119. .group-title {
  120. float: left;
  121. clear: none;
  122. width: 100%;
  123. height: 64px;
  124. line-height: 48px;
  125. text-align: center;
  126. font-size: 48px;
  127. }
  128. .group-stations {
  129. white-space: nowrap;
  130. text-align: center;
  131. overflow: hidden;
  132. float: left;
  133. clear: none;
  134. width: 100%;
  135. height: 400px;
  136. .stations-station {
  137. position: relative;
  138. top: 16px;
  139. display: inline-block;
  140. clear: none;
  141. width: 256px;
  142. height: 370px;
  143. margin: 0 16px 0 16px;
  144. box-shadow: 0 1px 6px 2px rgba(0, 0, 0, 0.25);
  145. cursor: pointer;
  146. .station-info {
  147. display: flex;
  148. flex-direction: row;
  149. align-items: center;
  150. }
  151. .station-image {
  152. width: 100%;
  153. height: 256px;
  154. object-fit: cover;
  155. }
  156. .station-grid-left {
  157. display: flex;
  158. flex-direction: column;
  159. width: 75%;
  160. text-align: left;
  161. padding-left: 10px;
  162. h3 {
  163. color: $blue;
  164. margin: 0;
  165. white-space: normal;
  166. padding-top: 10px;
  167. }
  168. p {
  169. margin: 0;
  170. white-space: normal;
  171. padding-top: 10px;
  172. }
  173. }
  174. .station-grid-right {
  175. display: flex;
  176. flex-direction: column;
  177. width: 25%;
  178. i {
  179. color: $blue;
  180. }
  181. }
  182. }
  183. }
  184. }
  185. </style>