CommunityHeader.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <nav class='nav'>
  3. <div class='nav-left'>
  4. <a class='nav-item logo' href='#' v-link='{ path: "/" }' @click='this.$dispatch("leaveStation", title)'>
  5. Musare
  6. </a>
  7. </div>
  8. <div class='nav-center stationDisplayName'>
  9. {{$parent.station.displayName}}
  10. </div>
  11. <span class="nav-toggle" :class="{ 'is-active': isMobile }" @click="isMobile = !isMobile">
  12. <span></span>
  13. <span></span>
  14. <span></span>
  15. </span>
  16. <div class="nav-right nav-menu" :class="{ 'is-active': isMobile }">
  17. <!-- DUPLICATE BUTTON TO HOLD FORMATTING -->
  18. <a class='nav-item' href='#' @click='$parent.toggleSidebar("users")'>
  19. <span class='icon'>
  20. <i class='material-icons'>people</i>
  21. </span>
  22. </a>
  23. </div>
  24. </nav>
  25. <div class="admin-sidebar">
  26. <div class='inner-wrapper'>
  27. <hr class="sidebar-top-hr">
  28. <div v-if='isOwner()'>
  29. <a class="sidebar-item" href='#' v-if='isOwner()' @click='$parent.editStation()'>
  30. <span class='icon'>
  31. <i class='material-icons'>settings</i>
  32. </span>
  33. <span class="icon-purpose">Station settings</span>
  34. </a>
  35. <a v-if='isOwner()' class="sidebar-item" href='#' @click='$parent.skipStation()'>
  36. <span class='icon'>
  37. <i class='material-icons'>skip_next</i>
  38. </span>
  39. <span class="icon-purpose">Skip current song</span>
  40. </a>
  41. <a class="sidebar-item" href='#' v-if='isOwner() && $parent.paused' @click='$parent.resumeStation()'>
  42. <span class='icon'>
  43. <i class='material-icons'>play_arrow</i>
  44. </span>
  45. <span class="icon-purpose">Resume station</span>
  46. </a>
  47. <a class="sidebar-item" href='#' v-if='isOwner() && !$parent.paused' @click='$parent.pauseStation()'>
  48. <span class='icon'>
  49. <i class='material-icons'>pause</i>
  50. </span>
  51. <span class="icon-purpose">Pause station</span>
  52. </a>
  53. <hr>
  54. </div>
  55. <div v-if="$parent.$parent.loggedIn && !$parent.noSong">
  56. <a v-if='!isOwner() && $parent.$parent.loggedIn && !$parent.noSong' class="sidebar-item" href='#' @click='$parent.voteSkipStation()'>
  57. <span class='icon'>
  58. <i class='material-icons'>skip_next</i>
  59. </span>
  60. <span class="skip-votes">{{ $parent.currentSong.skipVotes }}</span>
  61. <span class="icon-purpose">Skip current song</span>
  62. </a>
  63. <a v-if='$parent.$parent.loggedIn && !$parent.noSong' class="sidebar-item" href='#' @click='$parent.modals.addSongToPlaylist = true'>
  64. <span class='icon'>
  65. <i class='material-icons'>playlist_add</i>
  66. </span>
  67. <span class="icon-purpose">Add current song to playlist</span>
  68. </a>
  69. <hr>
  70. </div>
  71. <a class="sidebar-item" href='#' @click='$parent.toggleSidebar("songslist")' v-if='$parent.station.partyMode === true'>
  72. <span class='icon'>
  73. <i class='material-icons'>queue_music</i>
  74. </span>
  75. <span class="icon-purpose">Show the station queue</span>
  76. </a>
  77. <a class="sidebar-item" href='#' @click='$parent.toggleSidebar("users")'>
  78. <span class='icon'>
  79. <i class='material-icons'>people</i>
  80. </span>
  81. <span class="icon-purpose">Display users in the station</span>
  82. </a>
  83. <a class="sidebar-item" href='#' @click='$parent.toggleSidebar("playlist")' v-if='$parent.$parent.loggedIn'>
  84. <span class='icon'>
  85. <i class='material-icons'>library_music</i>
  86. </span>
  87. <span class="icon-purpose">Show your playlists</span>
  88. </a>
  89. </div>
  90. </div>
  91. </template>
  92. <script>
  93. export default {
  94. data() {
  95. return {
  96. title: this.$route.params.id,
  97. isMobile: false
  98. }
  99. },
  100. methods: {
  101. isOwner: function () {
  102. return this.$parent.$parent.loggedIn && (this.$parent.$parent.role === 'admin' || this.$parent.$parent.userId === this.$parent.station.owner);
  103. }
  104. }
  105. }
  106. </script>
  107. <style lang='scss' scoped>
  108. @import 'theme.scss';
  109. .nav {
  110. background-color: #03a9f4;
  111. }
  112. a.nav-item {
  113. color: $white;
  114. &:hover {
  115. color: $white;
  116. }
  117. padding: 0 18px;
  118. .icon {
  119. height: 64px;
  120. i {
  121. font-size: 2rem;
  122. line-height: 64px;
  123. height: 64px;
  124. width: 34px;
  125. }
  126. }
  127. }
  128. .skip-votes {
  129. position: relative;
  130. left: 11px;
  131. }
  132. .nav-toggle {
  133. height: 64px;
  134. }
  135. .logo {
  136. font-size: 2.1rem;
  137. line-height: 64px;
  138. padding-left: 20px !important;
  139. padding-right: 20px !important;
  140. }
  141. .nav-center {
  142. display: flex;
  143. align-items: center;
  144. color: $blue;
  145. font-size: 22px;
  146. }
  147. .nav-right.is-active .nav-item {
  148. background: #03a9f4;
  149. border: 0;
  150. }
  151. .admin-sidebar {
  152. position: fixed;
  153. z-index: 1;
  154. top: 0;
  155. left: 0;
  156. width: 64px;
  157. height: 100vh;
  158. background-color: #03a9f4;
  159. box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
  160. }
  161. .inner-wrapper {
  162. top: 64px;
  163. position: relative;
  164. }
  165. .admin-sidebar .material-icons {
  166. width: 100%;
  167. font-size: 2rem;
  168. }
  169. .admin-sidebar .sidebar-item {
  170. font-size: 2rem;
  171. height: 50px;
  172. color: white;
  173. -webkit-box-align: center;
  174. -ms-flex-align: center;
  175. align-items: center;
  176. display: -webkit-box;
  177. display: -ms-flexbox;
  178. display: flex;
  179. -webkit-box-flex: 0;
  180. -ms-flex-positive: 0;
  181. flex-grow: 0;
  182. -ms-flex-negative: 0;
  183. flex-shrink: 0;
  184. -webkit-box-pack: center;
  185. -ms-flex-pack: center;
  186. justify-content: center;
  187. width: 100%;
  188. position: relative;
  189. }
  190. .admin-sidebar .sidebar-top-hr {
  191. margin: 0 0 20px 0;
  192. }
  193. .sidebar-item .icon-purpose {
  194. visibility: hidden;
  195. width: 150px;
  196. font-size: 12px;
  197. background-color: rgba(3, 169, 244,0.8);
  198. color: #fff;
  199. text-align: center;
  200. border-radius: 6px;
  201. padding: 5px 0;
  202. position: absolute;
  203. z-index: 1;
  204. left: 105%;
  205. }
  206. .sidebar-item:hover .icon-purpose {
  207. visibility: visible;
  208. }
  209. </style>