OfficialHeader.vue 5.8 KB

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