MainHeader.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. <template>
  2. <nav class="nav is-info">
  3. <div class="nav-left">
  4. <a class="nav-item is-brand" href="#" v-link="{ path: '/' }">
  5. Musare
  6. </a>
  7. </div>
  8. <span class="nav-toggle" :class="{ 'is-active': isMobile }" @click="isMobile = !isMobile">
  9. <span></span>
  10. <span></span>
  11. <span></span>
  12. </span>
  13. <div class="nav-right nav-menu" :class="{ 'is-active': isMobile }">
  14. <a class="nav-item is-tab admin" href="#" v-link="{ path: '/admin' }" v-if="$parent.$parent.role === 'admin'">
  15. <strong>Admin</strong>
  16. </a>
  17. <!--a class="nav-item is-tab" href="#">
  18. About
  19. </a-->
  20. <a class="nav-item is-tab" href="#" v-link="{ path: '/team' }">
  21. Team
  22. </a>
  23. <a class="nav-item is-tab" href="#" v-link="{ path: '/about' }">
  24. About
  25. </a>
  26. <a class="nav-item is-tab" href="#" v-link="{ path: '/news' }">
  27. News
  28. </a>
  29. <span class="grouped" v-if="$parent.$parent.loggedIn">
  30. <a class="nav-item is-tab" href="#" v-link="{ path: '/u/' + $parent.$parent.username }">
  31. Profile
  32. </a>
  33. <a class="nav-item is-tab" href="#" v-link="{ path: '/settings' }">
  34. Settings
  35. </a>
  36. <a class="nav-item is-tab" href="#" @click="$parent.$parent.logout()">
  37. Logout
  38. </a>
  39. </span>
  40. <span class="grouped" v-else>
  41. <a class="nav-item" href="#" @click="toggleModal('login')">
  42. Login
  43. </a>
  44. <a class="nav-item" href="#" @click="toggleModal('register')">
  45. Register
  46. </a>
  47. </span>
  48. </div>
  49. </nav>
  50. </template>
  51. <script>
  52. export default {
  53. data() {
  54. return {
  55. isMobile: false
  56. }
  57. },
  58. methods: {
  59. toggleModal: function (type) {
  60. this.$dispatch('toggleModal', type);
  61. }
  62. }
  63. }
  64. </script>
  65. <style lang="scss" scoped>
  66. .nav {
  67. background-color: #03a9f4;
  68. height: 64px;
  69. .nav-menu.is-active {
  70. .nav-item {
  71. color: #333;
  72. &:hover {
  73. color: #333;
  74. }
  75. }
  76. }
  77. .nav-toggle {
  78. height: 64px;
  79. &.is-active span {
  80. background-color: #333;
  81. }
  82. }
  83. .is-brand {
  84. font-size: 2.1rem !important;
  85. line-height: 64px !important;
  86. padding: 0 20px;
  87. }
  88. .nav-item {
  89. font-size: 15px;
  90. color: hsl(0, 0%, 100%);
  91. &:hover {
  92. color: hsl(0, 0%, 100%);
  93. }
  94. }
  95. .admin {
  96. color: #424242;
  97. }
  98. }
  99. .grouped {
  100. margin: 0;
  101. display: flex;
  102. text-decoration: none;
  103. }
  104. .nightMode {
  105. .nav {
  106. background-color: #012332;
  107. height: 64px;
  108. .nav-menu.is-active {
  109. .nav-item {
  110. color: #333;
  111. &:hover {
  112. color: #333;
  113. }
  114. }
  115. }
  116. .nav-toggle {
  117. height: 64px;
  118. &.is-active span {
  119. background-color: #333;
  120. }
  121. }
  122. .is-brand {
  123. font-size: 2.1rem !important;
  124. line-height: 64px !important;
  125. padding: 0 20px;
  126. }
  127. .nav-item {
  128. font-size: 15px;
  129. color: hsl(0, 0%, 100%);
  130. &:hover {
  131. color: hsl(0, 0%, 100%);
  132. }
  133. }
  134. .admin strong {
  135. color: #03a9f4;
  136. }
  137. }
  138. }
  139. </style>