All files / components/admin navigation.vue

0% Statements 0/8
100% Branches 0/0
0% Functions 0/3
0% Lines 0/8

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143                                                                                                                                                                                                                                                                                             
<template>
  <nav class="navbar navbar-light bg-white px-3 justify-content-between justify-content-lg-end" aria-label="Main navigation">
    <button @click="enableSidebar"
            class="navbar-toggler pe-auto shadow-none border-0 py-0 d-flex d-lg-none align-items-center pe-0"
            type="button" id="navbarSideCollapse" aria-label="Toggle navigation">
            <span
              :class="{'d-none': !isBurgerMenuActive}"
              class="navbar-toggler-icon">
            </span>
      <span
        type="button"
        :class="{'d-none': !isCloseButtonActive}"
        class="btn-close shadow-none"
        aria-label="Close"></span>
    </button>
    <p class="mb-0">username021</p>
  </nav>
</template>
 
<script>
export default {
  data() {
    return {
      isBurgerMenuActive: true,
      isCloseButtonActive: false,
      isSidebarOpen: false
    }
  },
 
  emits: ['toggleSidebar'],
 
  methods: {
    /**
     * Toggle sidebar menu for mobile devices
     * @see enableSidebar
     * @returns void
     */
    enableSidebar() {
      this.isSidebarOpen = !this.isSidebarOpen;
      this.$emit('toggleSidebar', this.isSidebarOpen);
      this.isBurgerMenuActive = !this.isBurgerMenuActive;
      this.isCloseButtonActive = !this.isCloseButtonActive;
    }
  },
 
  watch: {
 
    /**
     * Close sidebar menu when route changes on mobile devices
     * @param {object} val
     * @returns void
     */
 
    '$route.path': function (val) {
      this.isOffCanvasOpen = false;
      this.isBurgerMenuActive = true;
      this.isCloseButtonActive = false;
    }
  }
}
</script>
 
<style lang="scss" scoped>
.navbar-toggler-icon {
  background-image: url('~/assets/svgs/burger-blue.svg');
  height: 3rem;
  width: 3rem;
}
 
.btn-close {
  background-image: url('~/assets/svgs/exit.svg');
  opacity: 1;
  width: 2.5rem;
  height: 2.5rem;
  background-size: 2.5rem 2.5rem;
}
 
.navbar {
  flex-wrap: nowrap;
  margin: .5rem;
  height: 5rem;
  border-radius: 10px;
}
 
.navbar::after {
  content: "";
  opacity: 1;
  position: absolute;
  z-index: 2;
  bottom: 0;
  left: 0;
  height: 10px;
  border-radius: 10px;
  width: 100%;
  box-shadow: 0 5px 6px -3px rgb(0 0 0 / 80%);
}
 
@include media-breakpoint-up(xxl) {
  .navbar {
    height: 8rem;
  }
}
 
@media screen and #{$ipad-pro-portrait-breakpoint},
screen and #{$ipad-pro-landscape-breakpoint},
screen and #{$ipad-landscape-breakpoint} {
  .navbar {
    height: 4rem;
    justify-content: space-between !important;
  }
 
  .navbar-toggler {
    display: flex !important;
  }
 
  //.btn-close {
  //  width: 3rem;
  //  height: 3rem;
  //  background-size: 3rem 3rem;
  //}
}
 
@include media-breakpoint-down(lg) {
  .navbar {
    height: 4rem;
  }
 
  .navbar-toggler-icon {
    height: 2.5rem;
    width: 2.5rem;
  }
 
 
  //.btn-close {
  //  width: 3rem;
  //  height: 3rem;
  //  background-size: 3rem 3rem;
  //}
}
 
 
</style>