MainHeader.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  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. @import 'theme.scss';
  67. .nav {
  68. background-color: #03a9f4;
  69. height: 64px;
  70. .nav-menu.is-active {
  71. .nav-item {
  72. color: #333;
  73. &:hover {
  74. color: #333;
  75. }
  76. }
  77. }
  78. .nav-toggle {
  79. height: 64px;
  80. &.is-active span {
  81. background-color: #333;
  82. }
  83. }
  84. .is-brand {
  85. font-size: 2.1rem !important;
  86. line-height: 64px !important;
  87. padding: 0 20px;
  88. }
  89. .nav-item {
  90. font-size: 15px;
  91. color: $white;
  92. &:hover {
  93. color: $white;
  94. }
  95. }
  96. .admin {
  97. color: #424242;
  98. }
  99. }
  100. .grouped {
  101. margin: 0;
  102. display: flex;
  103. text-decoration: none;
  104. }
  105. </style>