menu.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <div class="bottom-menu animation--hack-browser-bug--stack-too-high">
  3. <ul class="b-ul">
  4. <li
  5. :class="[
  6. 'b-li',
  7. `${idx == currentTimeIdx ? 'active' : ''}`,
  8. `${$isMobile ? 'mobile' : 'pc'}`,
  9. ]"
  10. @click="emit('onClickTimeItem', idx)"
  11. v-for="(timeItem, idx) in list"
  12. :key="timeItem.id"
  13. >
  14. <div></div>
  15. <p>{{ timeItem.info.textCn }}</p>
  16. </li>
  17. </ul>
  18. <ul class="b-right" >
  19. <li
  20. class="br-li"
  21. @click="emit('onClickMenuItem', rmenu[0])"
  22. >
  23. <img :src="bgAudioStatus ? rmenu[0].imgOn : rmenu[0].imgOff" alt="" draggable="false">
  24. </li>
  25. <li
  26. class="br-li"
  27. @click="emit('onClickMenuItem', item)"
  28. v-for="item in rmenu.slice(1)" :key="item.id"
  29. >
  30. <img :src="item.img" alt="" draggable="false">
  31. </li>
  32. </ul>
  33. </div>
  34. </template>
  35. <script setup>
  36. import { shallowReactive } from "vue"
  37. const props = defineProps({
  38. list: Array,
  39. currentTimeIdx:Number,
  40. bgAudioStatus: Boolean,
  41. })
  42. const emit = defineEmits(['onClickTimeItem','onClickMenuItem'])
  43. const rmenu = shallowReactive([{
  44. name: '背景音乐',
  45. imgOn: utils.getImageUrl(`icon_music_on.png`),
  46. imgOff: utils.getImageUrl(`icon_music_off.png`),
  47. id: 'bgAudio'
  48. }, {
  49. name: '帮助',
  50. img: utils.getImageUrl(`icon_tip.png`),
  51. id: 'tip'
  52. }, {
  53. name: '搜索',
  54. img: utils.getImageUrl(`icon_search.png`),
  55. id: 'search'
  56. }, {
  57. name: '主页',
  58. img: utils.getImageUrl(`icon_home.png`),
  59. id: 'home'
  60. }
  61. ])
  62. </script>
  63. <style lang="scss" scoped>
  64. .bottom-menu {
  65. --thiscolor: #72928E;
  66. position: absolute;
  67. bottom: 0;
  68. left: 0;
  69. width: 100%;
  70. height: 5rem;
  71. background: rgba(255, 241, 209, 0.5);
  72. box-shadow: 0px 0px 50px 0px rgba(206, 186, 141, 0.6), inset 0px 2px 2px 0px rgba(255, 255, 255, 0.25);
  73. backdrop-filter: blur(20px);
  74. display: flex;
  75. align-items: center;
  76. .b-ul {
  77. display: flex;
  78. width: 80%;
  79. position: relative;
  80. &::before {
  81. border-top: 1px dashed var(--thiscolor);
  82. width: 90%;
  83. height: 1px;
  84. content: '';
  85. display: inline-block;
  86. position: absolute;
  87. top: 0.4rem;
  88. left: 50%;
  89. transform: translateX(-50%);
  90. }
  91. .b-li {
  92. text-align: center;
  93. flex: 1;
  94. cursor: pointer;
  95. transition: .2s ease transform;
  96. &.active {
  97. transform: scale(1.1);
  98. --thiscolor: #783435;
  99. }
  100. &.pc:hover {
  101. transform: scale(1.1);
  102. --thiscolor: #783435;
  103. }
  104. >div {
  105. width: 0.8rem;
  106. height: 0.8rem;
  107. border-radius: 50%;
  108. display: inline-block;
  109. background: var(--thiscolor);
  110. position: relative;
  111. &::after {
  112. position: absolute;
  113. width: 200%;
  114. height: 200%;
  115. content: '';
  116. border-radius: 50%;
  117. display: inline-block;
  118. border: 1px solid var(--thiscolor);
  119. position: absolute;
  120. top: 50%;
  121. left: 50%;
  122. transform: translate(-50%, -50%);
  123. }
  124. }
  125. >p {
  126. color: var(--thiscolor);
  127. font-size: 0.8rem;
  128. margin-top: 1rem;
  129. }
  130. }
  131. }
  132. .b-right {
  133. display: flex;
  134. width: 20%;
  135. position: relative;
  136. justify-content: space-evenly;
  137. .br-li {
  138. cursor: pointer;
  139. width: 2rem;
  140. >img {
  141. width: 100%;
  142. }
  143. }
  144. }
  145. }
  146. </style>