You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

209 lines
4.5 KiB

4 weeks ago
  1. <script setup>
  2. import { onMounted, ref } from 'vue'
  3. import { useRouter } from 'vue-router'
  4. import bgImage from '@/assets/img/homePage/bk.png'
  5. import topIcon from '@/assets/img/homePage/AIicon.png'
  6. import btnIcon from '@/assets/img/homePage/count-box.png'
  7. import { setHeight } from '@/utils/setHeight'
  8. const router = useRouter()
  9. const pageRef = ref(null)
  10. onMounted(() => {
  11. setHeight(pageRef.value)
  12. })
  13. const goToHomePage = () => {
  14. router.push('/homepage') // 修改为实际路由
  15. }
  16. </script>
  17. <template>
  18. <div ref="pageRef" class="homepage" :style="{ backgroundImage: `url(${bgImage})` }">
  19. <!-- 顶部图标 -->
  20. <img class="top-icon" :src="topIcon" alt="顶部图标" />
  21. <!-- 主标题 -->
  22. <div class="main-title">夺宝奇兵大模型</div>
  23. <!-- 副标题 -->
  24. <div class="sub-title">构建场景化交易</div>
  25. <!-- 中间文字 -->
  26. <div class="footer-text">
  27. 数据可计算<br />
  28. 场景可演绎<br />
  29. 交易可掌控<br />
  30. </div>
  31. <!-- 底部按钮 -->
  32. <div class="buttons-container">
  33. <button class="btn-item" @click="goToHomePage">
  34. <img src="src\assets\img\homePage\count-box.png" alt="按钮图片" />
  35. <span class="btn-text">开启财运</span>
  36. </button>
  37. </div>
  38. </div>
  39. </template>
  40. <style scoped>
  41. .homepage {
  42. width: 100vw;
  43. height: 100vh;
  44. background-size: cover;
  45. background-position: center;
  46. background-repeat: no-repeat;
  47. /* 使用flex布局,居中内容 */
  48. display: flex;
  49. flex-direction: column;
  50. justify-content: center;
  51. /* 居中内容 */
  52. align-items: center;
  53. /* 水平对齐 */
  54. color: white;
  55. text-align: center;
  56. box-sizing: border-box;
  57. padding: 0 20px;
  58. }
  59. /* 顶部图标 - 向上调整 */
  60. .top-icon {
  61. width: 140px;
  62. height: 140px;
  63. margin-top: 50px;
  64. /* 向上调整图标位置 */
  65. }
  66. /* 主标题 */
  67. .main-title {
  68. margin-top: 1.5rem;
  69. font-size: 4rem;
  70. font-weight: bold;
  71. text-align: center;
  72. letter-spacing: 7px;
  73. }
  74. /* 副标题 */
  75. .sub-title {
  76. font-size: 3.1rem;
  77. font-weight: 500;
  78. margin-top: 0.5rem;
  79. font-weight: bold;
  80. letter-spacing: 5px;
  81. }
  82. /* 中间文字 */
  83. .footer-text {
  84. font-size: 40px;
  85. line-height: 1.6;
  86. max-width: 320px;
  87. margin-top: 3%;
  88. white-space: pre-line;
  89. user-select: none;
  90. text-align: center;
  91. font-weight: bold;
  92. line-height: 4.5rem;
  93. }
  94. /* 按钮容器 */
  95. .buttons-container {
  96. width: 100%;
  97. display: flex;
  98. justify-content: center;
  99. margin-top: 100px; /* 向下移动按钮 */
  100. }
  101. /* 按钮样式 */
  102. .btn-item {
  103. position: relative;
  104. background-color: transparent;
  105. border: none;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. cursor: pointer;
  110. text-align: center;
  111. padding: 20px;
  112. }
  113. /* 按钮图标 */
  114. .btn-item img {
  115. width: 160px; /* 调整按钮图片大小 */
  116. height: 200%;
  117. }
  118. /* 按钮文字 */
  119. .btn-text {
  120. position: absolute;
  121. font-size: 30px; /* 设置文字大小 */
  122. color: #eccf27; /* 设置黄色字体 */
  123. font-weight: bold;
  124. letter-spacing: 2px; /* 设置字母间距 */
  125. text-align: center; /* 文字居中 */
  126. z-index: 1; /* 确保文字显示在按钮图片上 */
  127. }
  128. /* 响应式 - 手机 */
  129. @media screen and (max-width: 600px) {
  130. .top-icon {
  131. width: 100px;
  132. height: 100px;
  133. margin-bottom: 20px;
  134. }
  135. .main-title {
  136. font-size: 40px;
  137. }
  138. .sub-title {
  139. font-size: 30px;
  140. margin-top: 0.5rem;
  141. }
  142. .footer-text {
  143. font-size: 30px;
  144. max-width: 260px;
  145. margin-top: 40px;
  146. line-height: 3.5rem;
  147. }
  148. .btn-item img {
  149. width: 130px;
  150. }
  151. .btn-text {
  152. font-size: 24px; /* 调整手机上的字体大小 */
  153. }
  154. }
  155. /* 响应式 - 平板 */
  156. @media screen and (min-width: 601px) and (max-width: 1024px) {
  157. .top-icon {
  158. width: 120px;
  159. height: 120px;
  160. margin-bottom: 25px;
  161. }
  162. .footer-text {
  163. font-size: 40px;
  164. max-width: 260px;
  165. margin-top: 40px;
  166. line-height: 3.5rem;
  167. }
  168. .main-title {
  169. font-size: 40px;
  170. }
  171. .sub-title {
  172. font-size: 35px;
  173. margin-top: 0.5rem;
  174. }
  175. .btn-item img {
  176. width: 140px;
  177. }
  178. .btn-text {
  179. font-size: 28px; /* 调整平板上的字体大小 */
  180. }
  181. }
  182. </style>