AIImageToVideo.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <!-- 图生视频 -->
  3. <div class="home-container">
  4. <!-- 展开收起侧边栏 -->
  5. <div
  6. class="icon-expand"
  7. :style="{
  8. backgroundColor: drawerVisible ? '#44449c' : '#7F70C840',
  9. left: drawerVisible ? '18%' : '0'
  10. }"
  11. @click="toggleDrawer"
  12. >
  13. <span
  14. class="vertical-lines"
  15. :style="{
  16. color: drawerVisible ? '#8a78d0' : 'white'
  17. }"
  18. >||</span
  19. >
  20. </div>
  21. <!-- 左侧折叠面板 -->
  22. <LeftPanel ref="leftPanelRef" v-if="drawerVisible"/>
  23. <div class="left-group2">
  24. <div class="title-box">
  25. <div class="box-icon" @click="goBack">
  26. <el-icon class="left-icon"><ArrowLeftBold /></el-icon>
  27. 图生视频
  28. </div>
  29. </div>
  30. <div class="img-box">
  31. <p>
  32. <img
  33. style=" width: fit-content; height: 180px; margin: 10px;"
  34. src="@/assets/images/color.png"
  35. class="avatar user"
  36. />
  37. </p>
  38. <p>期待你的画作喔~</p>
  39. </div>
  40. </div>
  41. <!-- 右侧图生视频组件 -->
  42. <ImageToVideo />
  43. </div>
  44. </template>
  45. <script setup>
  46. import { ref } from 'vue'
  47. import { useRouter } from 'vue-router'
  48. import { ArrowLeftBold } from '@element-plus/icons-vue'
  49. import LeftPanel from '@/components/LeftPanel.vue'
  50. import ImageToVideo from '@/components/ai/video/ImageToVideo.vue'
  51. const router = useRouter()
  52. const leftPanelRef = ref(null)
  53. const drawerVisible = ref(true)
  54. // 返回上一页
  55. const goBack = () => {
  56. router.push('/ai-laboratory')
  57. }
  58. // 添加切换抽屉显示状态的函数
  59. const toggleDrawer = () => {
  60. drawerVisible.value = !drawerVisible.value
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. @use 'sass:math';
  65. // 定义rpx转换函数
  66. @function rpx($px) {
  67. @return math.div($px, 750) * 100vw;
  68. }
  69. .home-container {
  70. position: fixed;
  71. top: 0;
  72. left: 0;
  73. right: 0;
  74. bottom: 0;
  75. display: flex;
  76. flex-direction: row;
  77. gap: rpx(0);
  78. background: linear-gradient(
  79. to bottom,
  80. #e2ddfc,
  81. #f1effd
  82. );
  83. }
  84. .icon-expand {
  85. width: rpx(8);
  86. height: rpx(35);
  87. border-top-right-radius: rpx(5);
  88. border-bottom-right-radius: rpx(5);
  89. z-index: 9999;
  90. position: absolute;
  91. top: 50%;
  92. left: 18%;
  93. transform: translateY(-50%);
  94. background-color: #44449c;
  95. cursor: pointer;
  96. clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. transition: all 0.3s ease;
  101. }
  102. .icon-expand .vertical-lines {
  103. color: #8a78d0;
  104. font-size: rpx(10);
  105. }
  106. .left-group2 {
  107. width: rpx(150);
  108. height: 100%;
  109. background-color: #ece9fd;
  110. }
  111. .left-group2 img {
  112. width: rpx(110);
  113. height: auto;
  114. margin-top: rpx(30);
  115. }
  116. .title-box {
  117. height: rpx(50);
  118. }
  119. .box-icon {
  120. width: 100%;
  121. height: 100%;
  122. flex: 1;
  123. display: flex;
  124. align-items: center;
  125. color: black;
  126. padding-left: rpx(15);
  127. font-size: rpx(10);
  128. cursor: pointer;
  129. }
  130. .box-icon .left-icon {
  131. margin-left: rpx(10);
  132. margin-right: rpx(5);
  133. }
  134. .img-box {
  135. margin-top: rpx(50);
  136. color: #a39dce;
  137. }
  138. </style>