index.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <template>
  2. <div class="bottom-box">
  3. <div class="button-part flex flex-col items-center justify-center relative">
  4. <div
  5. :class="[
  6. 'transition-all absolute top--10 mb-2',
  7. show ? 'transform-rotate-z-0' : 'transform-rotate-z-180'
  8. ]"
  9. >
  10. <img
  11. :class="[
  12. 'cursor-pointer relative animate__animated animate__bounce animate__slow animate__slideInUp'
  13. ]"
  14. src="@/assets/images/up-icon.png"
  15. @click="handleClick"
  16. />
  17. </div>
  18. <transition name="scaleHide" @after-enter="onAfterEnter">
  19. <div v-if="show" :class="['part-plan w-full flex justify-between']">
  20. <div
  21. class="w-50% first:mr-2 relative flex flex-col bg-#00000080 overflow-hidden"
  22. v-for="(part, i) in partList"
  23. :key="i"
  24. >
  25. <UWindow :currentActive="i"></UWindow>
  26. </div>
  27. </div>
  28. </transition>
  29. </div>
  30. </div>
  31. </template>
  32. <script setup>
  33. import { $mitt } from '@/utils'
  34. import { useOutsideHomeStore } from '@/stores/modules/home'
  35. const useHomeStore = useOutsideHomeStore()
  36. const route = useRoute()
  37. const show = ref(false)
  38. const partList = ref([
  39. {
  40. class: 'part-plan1'
  41. },
  42. {
  43. class: 'part-plan2'
  44. }
  45. ])
  46. const handleClick = () => {
  47. show.value = !show.value
  48. $mitt.emit('onVideoShow', show.value)
  49. }
  50. const onAfterEnter = (el) => {
  51. el.style.height = '267px'
  52. }
  53. watch(
  54. () => useHomeStore.temp,
  55. (newV) => {
  56. if (newV === 'video') {
  57. show.value = true
  58. } else {
  59. show.value = false
  60. }
  61. },
  62. { immediate: true }
  63. )
  64. </script>
  65. <style lang="scss">
  66. .scaleHide-enter-active {
  67. animation: bounce-in 0.5s;
  68. }
  69. .scaleHide-leave-active {
  70. animation: bounce-in 0.5s reverse;
  71. }
  72. @keyframes bounce-in {
  73. 0% {
  74. height: 0;
  75. }
  76. 100% {
  77. height: 267px;
  78. }
  79. }
  80. </style>