TopNav.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <template>
  2. <div class="topnav">
  3. <i class="topnav-logo" />
  4. <h3 class="limit-line">武警北京市总执勤第十三支队数字史馆</h3>
  5. <i class="topnav-menu" @click="menuVisible = !menuVisible" />
  6. </div>
  7. <Sidebar v-model:show="menuVisible" />
  8. </template>
  9. <script setup>
  10. import { ref } from "vue";
  11. import Sidebar from "./Sidebar.vue";
  12. const menuVisible = ref(false);
  13. </script>
  14. <style lang="scss" scoped>
  15. .topnav {
  16. position: fixed;
  17. top: 0;
  18. left: 0;
  19. right: 0;
  20. padding: 0 80px 0 130px;
  21. height: 100px;
  22. line-height: 100px;
  23. color: white;
  24. font-size: 27px;
  25. background: #c50b10;
  26. box-shadow: 0px 2px 3px rgba(0, 0, 0, 0.15);
  27. z-index: var(--z-hot-popper);
  28. &-logo {
  29. position: absolute;
  30. top: -8px;
  31. left: 15px;
  32. display: block;
  33. width: 104px;
  34. height: 123px;
  35. background: url("@/assets/images/logo-bg-min.png") no-repeat center /
  36. contain;
  37. &::before {
  38. content: "";
  39. position: absolute;
  40. top: 8px;
  41. left: 50%;
  42. width: 90px;
  43. height: 88px;
  44. background: url("@/assets/images/logo-min.png") no-repeat center / contain;
  45. transform: translateX(-50%);
  46. }
  47. }
  48. &-menu {
  49. position: absolute;
  50. top: 50%;
  51. right: 27px;
  52. width: 36px;
  53. height: 36px;
  54. background: url("@/assets/images/menu-min.png") no-repeat center / contain;
  55. transform: translateY(-50%);
  56. }
  57. }
  58. </style>