menu.vue 3.1 KB

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