CommunityHeader.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 v-if='isOwner()' class='nav-item' href='#' @click='$parent.skipStation()'>
  13. <span class='icon'>
  14. <i class='material-icons'>skip_next</i>
  15. </span>
  16. </a>
  17. <a v-if='!isOwner() && $parent.$parent.loggedIn && !$parent.noSong' class='nav-item' href='#' @click='$parent.voteSkipStation()'>
  18. <span class='icon'>
  19. <i class='material-icons'>skip_next</i>
  20. </span>
  21. <span class="skip-votes">{{ $parent.currentSong.skipVotes }}</span>
  22. </a>
  23. <a v-if='$parent.$parent.loggedIn && !$parent.noSong && !$parent.simpleSong' class='nav-item' href='#' @click='$parent.modals.report = !$parent.modals.report'>
  24. <span class='icon'>
  25. <i class='material-icons'>report</i>
  26. </span>
  27. </a>
  28. <a class='nav-item' href='#' v-if='isOwner() && $parent.paused' @click='$parent.resumeStation()'>
  29. <span class='icon'>
  30. <i class='material-icons'>play_arrow</i>
  31. </span>
  32. </a>
  33. <a class='nav-item' href='#' v-if='isOwner() && !$parent.paused' @click='$parent.pauseStation()'>
  34. <span class='icon'>
  35. <i class='material-icons'>pause</i>
  36. </span>
  37. </a>
  38. </div>
  39. <div class='nav-center stationDisplayName'>
  40. {{$parent.station.displayName}}
  41. </div>
  42. <span class="nav-toggle" :class="{ 'is-active': isMobile }" @click="isMobile = !isMobile">
  43. <span></span>
  44. <span></span>
  45. <span></span>
  46. </span>
  47. <div class="nav-right nav-menu" :class="{ 'is-active': isMobile }">
  48. <a class='nav-item' href='#' @click='$parent.toggleSidebar("songslist")' v-if='$parent.station.partyMode === true'>
  49. <span class='icon'>
  50. <i class='material-icons'>queue_music</i>
  51. </span>
  52. </a>
  53. <!--<a class='nav-item' href='#'>
  54. <span class='icon'>
  55. <i class='material-icons'>chat</i>
  56. </span>
  57. </a>-->
  58. <a class='nav-item' href='#' @click='$parent.toggleSidebar("users")'>
  59. <span class='icon'>
  60. <i class='material-icons'>people</i>
  61. </span>
  62. </a>
  63. <a class='nav-item' href='#' @click='$parent.toggleSidebar("playlist")' v-if='$parent.$parent.loggedIn'>
  64. <span class='icon'>
  65. <i class='material-icons'>library_music</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' || this.$parent.$parent.userId === this.$parent.station.owner);
  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>