HeaderH5.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <header class="h5-header">
  3. <div class="h5-header-container">
  4. <a href="/" class="brand">
  5. <NuxtPicture src="/logo.png" alt="DDAC logo" class="brand-logo" width="24" height="24"></NuxtPicture>
  6. <h1 class="brand-title">DDAC</h1>
  7. </a>
  8. <button class="menu-button" @click="toggleMenu">
  9. <span class="menu-icon"></span>
  10. </button>
  11. </div>
  12. <nav v-show="isMenuOpen" class="h5-nav">
  13. <div class="nav-item">首页</div>
  14. <div class="nav-item">产品</div>
  15. <div class="nav-item">行业解决方案</div>
  16. <div class="nav-item">文档中心</div>
  17. <div class="nav-item">了解我们</div>
  18. <div class="nav-actions">
  19. <div class="nav-action-item">登录</div>
  20. <div class="nav-action-item register">注册</div>
  21. </div>
  22. </nav>
  23. </header>
  24. </template>
  25. <script setup>
  26. const isMenuOpen = ref(false)
  27. const toggleMenu = () => {
  28. isMenuOpen.value = !isMenuOpen.value
  29. }
  30. </script>
  31. <style lang="scss" scoped>
  32. .h5-header {
  33. position: fixed;
  34. top: 0;
  35. left: 0;
  36. right: 0;
  37. z-index: 1000;
  38. background: #030014;
  39. border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  40. }
  41. .h5-header-container {
  42. display: flex;
  43. justify-content: space-between;
  44. align-items: center;
  45. padding: 12px 16px;
  46. }
  47. .brand {
  48. display: flex;
  49. align-items: center;
  50. text-decoration: none;
  51. .brand-logo {
  52. margin-right: 8px;
  53. }
  54. .brand-title {
  55. color: #FFF;
  56. font-family: Roboto;
  57. font-size: 20px;
  58. font-weight: 700;
  59. line-height: 24px;
  60. margin: 0;
  61. }
  62. }
  63. .menu-button {
  64. width: 32px;
  65. height: 32px;
  66. background: none;
  67. border: none;
  68. cursor: pointer;
  69. display: flex;
  70. align-items: center;
  71. justify-content: center;
  72. padding: 0;
  73. }
  74. .menu-icon {
  75. display: block;
  76. width: 24px;
  77. height: 2px;
  78. background-color: #fff;
  79. position: relative;
  80. &::before,
  81. &::after {
  82. content: '';
  83. position: absolute;
  84. width: 24px;
  85. height: 2px;
  86. background-color: #fff;
  87. left: 0;
  88. }
  89. &::before {
  90. top: -8px;
  91. }
  92. &::after {
  93. top: 8px;
  94. }
  95. }
  96. .h5-nav {
  97. background: #030014;
  98. border-top: 1px solid rgba(255, 255, 255, 0.1);
  99. padding: 16px;
  100. }
  101. .nav-item {
  102. padding: 12px 0;
  103. color: #FFF;
  104. font-family: "Source Han Sans CN";
  105. font-size: 16px;
  106. border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  107. &:last-of-type {
  108. border-bottom: none;
  109. }
  110. }
  111. .nav-actions {
  112. display: flex;
  113. gap: 12px;
  114. margin-top: 16px;
  115. }
  116. .nav-action-item {
  117. flex: 1;
  118. padding: 12px;
  119. text-align: center;
  120. color: #FFF;
  121. font-family: "Source Han Sans CN";
  122. font-size: 14px;
  123. border-radius: 8px;
  124. background: rgba(255, 255, 255, 0.05);
  125. &.register {
  126. background: linear-gradient(91deg, #A39DFF 1.24%, #7D46FF 122.93%);
  127. }
  128. }
  129. </style>