OfficialHeader.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. <a class='nav-item' href='#' v-if='isOwner()' @click='$parent.editStation()'>
  8. <span class='icon'>
  9. <i class='material-icons'>settings</i>
  10. </span>
  11. </a>
  12. <a class='nav-item' href='#' @click='$parent.modals.addSongToQueue = !$parent.modals.addSongToQueue' v-if='$parent.type === "official" && $parent.$parent.loggedIn'>
  13. <span class='icon'>
  14. <i class='material-icons'>queue_music</i>
  15. </span>
  16. </a>
  17. <a v-if='isOwner()' class='nav-item' href='#' @click='$parent.skipStation()'>
  18. <span class='icon'>
  19. <i class='material-icons'>skip_next</i>
  20. </span>
  21. </a>
  22. <a v-if='!isOwner() && $parent.$parent.loggedIn && !$parent.noSong' class='nav-item' href='#' @click='$parent.voteSkipStation()'>
  23. <span class='icon'>
  24. <i class='material-icons'>skip_next</i>
  25. </span>
  26. <span class="skip-votes">{{$parent.currentSong.skipVotes}}</span>
  27. </a>
  28. <a v-if='$parent.$parent.loggedIn && !$parent.noSong && !$parent.simpleSong' class='nav-item' href='#' @click='$parent.modals.report = !$parent.modals.report'>
  29. <span class='icon'>
  30. <i class='material-icons'>report</i>
  31. </span>
  32. </a>
  33. <a class='nav-item' href='#' v-if='isOwner() && $parent.paused' @click='$parent.resumeStation()'>
  34. <span class='icon'>
  35. <i class='material-icons'>play_arrow</i>
  36. </span>
  37. </a>
  38. <a class='nav-item' href='#' v-if='isOwner() && !$parent.paused' @click='$parent.pauseStation()'>
  39. <span class='icon'>
  40. <i class='material-icons'>pause</i>
  41. </span>
  42. </a>
  43. </div>
  44. <div class='nav-center stationDisplayName'>
  45. {{ $parent.station.displayName }}
  46. </div>
  47. <span class="nav-toggle" :class="{ 'is-active': isMobile }" @click="isMobile = !isMobile">
  48. <span></span>
  49. <span></span>
  50. <span></span>
  51. </span>
  52. <div class="nav-right nav-menu" :class="{ 'is-active': isMobile }">
  53. <a class='nav-item' href='#' @click='$parent.toggleSidebar("songslist")'>
  54. <span class='icon'>
  55. <i class='material-icons'>queue_music</i>
  56. </span>
  57. </a>
  58. <!--<a class='nav-item' href='#'>
  59. <span class='icon'>
  60. <i class='material-icons'>chat</i>
  61. </span>
  62. </a>-->
  63. <a class='nav-item' href='#' @click='$parent.toggleSidebar("users")'>
  64. <span class='icon'>
  65. <i class='material-icons'>people</i>
  66. </span>
  67. </a>
  68. </div>
  69. </nav>
  70. </template>
  71. <script>
  72. export default {
  73. data() {
  74. return {
  75. title: this.$route.params.id,
  76. isMobile: false
  77. }
  78. },
  79. methods: {
  80. isOwner: function () {
  81. return this.$parent.$parent.loggedIn && this.$parent.$parent.role === 'admin';
  82. }
  83. }
  84. }
  85. </script>
  86. <style lang='scss' scoped>
  87. @import 'theme.scss';
  88. .nav {
  89. background-color: #03a9f4;
  90. }
  91. a.nav-item {
  92. color: $white;
  93. &:hover {
  94. color: $white;
  95. }
  96. padding: 0 18px;
  97. .icon {
  98. height: 64px;
  99. i {
  100. font-size: 2rem;
  101. line-height: 64px;
  102. height: 64px;
  103. width: 34px;
  104. }
  105. }
  106. }
  107. .skip-votes {
  108. position: relative;
  109. left: 11px;
  110. }
  111. .nav-toggle {
  112. height: 64px;
  113. }
  114. .logo {
  115. font-size: 2.1rem;
  116. line-height: 64px;
  117. padding-left: 20px !important;
  118. padding-right: 20px !important;
  119. }
  120. .nav-center {
  121. display: flex;
  122. align-items: center;
  123. color: $blue;
  124. font-size: 22px;
  125. }
  126. .nav-right.is-active .nav-item {
  127. background: #03a9f4;
  128. border: 0;
  129. }
  130. </style>