HomeView.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div class="home">
  3. <video
  4. src="@/assets/videos/startup.mp4"
  5. autoplay
  6. playsinline
  7. webkit-playsinline="true"
  8. x5-video-player-type="h5"
  9. muted
  10. />
  11. <Transition name="fade-in">
  12. <div
  13. v-show="isShowBtnGroup"
  14. class="btn-group"
  15. >
  16. <button @click="onClickBegin">
  17. 开始探索
  18. </button>
  19. <button
  20. id="copy-text"
  21. :data-clipboard-text="shareUrl"
  22. data-clipboard-action="copy"
  23. @click="onClickCopy"
  24. >
  25. 分享
  26. </button>
  27. </div>
  28. </Transition>
  29. <Transition name="fade-in">
  30. <div
  31. v-show="isShowBtnGroup"
  32. class="btn-right"
  33. >
  34. <div
  35. class="right-item"
  36. @click="isShowForeword = true,forwordType = 1"
  37. >
  38. <div
  39. class="item-circle"
  40. style="background: #8BD3FF;"
  41. >
  42. <img
  43. src="@/assets/images/gratitude-icon.png"
  44. alt=""
  45. >
  46. </div>
  47. 特别鸣谢
  48. </div>
  49. <div
  50. class="right-item"
  51. @click="isShowForeword = true,forwordType = 2"
  52. >
  53. <div class="item-circle">
  54. <img
  55. src="@/assets/images/foreword-icon.png"
  56. alt=""
  57. >
  58. </div>
  59. 策展人说
  60. </div>
  61. <div class="right-item">
  62. <div
  63. class="item-circle"
  64. style="background: #E89795;"
  65. @click="router.push({
  66. name: 'StartView',
  67. })"
  68. >
  69. <img
  70. src="@/assets/images/pic-icon.png"
  71. alt=""
  72. >
  73. </div>
  74. 体验版画
  75. </div>
  76. </div>
  77. </Transition>
  78. <!-- 序言 -->
  79. <ForeWord
  80. v-show="isShowForeword"
  81. :number="forwordType"
  82. @close="close"
  83. />
  84. </div>
  85. </template>
  86. <script setup>
  87. import Clipboard from "clipboard"
  88. import { showToast } from "@/store/index.js"
  89. import { useRoute, useRouter } from "vue-router"
  90. import { ref } from "vue"
  91. import ForeWord from "@/components/ForeWord.vue"
  92. const {
  93. windowSizeInCssForRef,
  94. windowSizeWhenDesignForRef,
  95. } = useSizeAdapt(724, 375)
  96. const route = useRoute()
  97. const router = useRouter()
  98. const isShowBtnGroup = ref(false)
  99. setTimeout(() => {
  100. isShowBtnGroup.value = true
  101. }, 2500)
  102. const isShowForeword = ref(false)
  103. const forwordType = ref(1)
  104. const close = () => {
  105. isShowForeword.value = false
  106. }
  107. const shareUrl = location.origin + location.pathname
  108. function onClickBegin() {
  109. router.push({
  110. name: 'EntryList'
  111. })
  112. }
  113. function onClickCopy() {
  114. let clipboard = new Clipboard("#copy-text")
  115. clipboard.on("success", function() {
  116. showToast('地址已复制到剪贴板')
  117. })
  118. }
  119. </script>
  120. <style lang="less" scoped>
  121. .home{
  122. position: absolute;
  123. left: 0;
  124. top: 0;
  125. width: 100%;
  126. height: 100%;
  127. // background-image: url(@/assets/images/cover-bg.jpg);
  128. // background-size: cover;
  129. // background-repeat: no-repeat;
  130. // background-position: center center;
  131. >video{
  132. position: absolute;
  133. left: 0;
  134. top: 0;
  135. width: 100%;
  136. height: 100%;
  137. object-fit: cover;
  138. }
  139. >.btn-group{
  140. position: absolute;
  141. bottom: calc(40 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  142. width: 100%;
  143. display: flex;
  144. justify-content: center;
  145. align-items: center;
  146. >button{
  147. flex: 0 0 auto;
  148. // letter-spacing: .3em;
  149. font-size: calc(22 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  150. font-family: 'jiangxizhuokai-Regular';
  151. // font-weight: bold;
  152. color: white;
  153. background-color: rgba(239, 196, 27, 1);
  154. border-radius: calc(50 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  155. border: solid calc(4 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef')) #fff;
  156. line-height: calc(23 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  157. height: calc(55 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));;
  158. }
  159. >button:first-of-type{
  160. background-repeat: no-repeat;
  161. background-position: center center;
  162. width: calc(186 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  163. margin-right: calc(17 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  164. }
  165. >button:last-of-type{
  166. background-color: #4ABBFF;
  167. background-repeat: no-repeat;
  168. background-position: center center;
  169. width: calc(144 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));;
  170. }
  171. }
  172. >.btn-right {
  173. position: absolute;
  174. right: 2%;
  175. top:5%;
  176. >.right-item {
  177. margin-bottom: calc(15 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  178. font-size: calc(14 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  179. color: white;
  180. display: flex;
  181. flex-direction: column;
  182. justify-content: center;
  183. align-items: center;
  184. >.item-circle {
  185. border-radius: calc(50 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  186. border: 2px solid white;
  187. padding: 10%;
  188. display: flex;
  189. justify-content: center;
  190. align-items: center;
  191. margin-bottom: calc(5 / v-bind('windowSizeWhenDesignForRef') * v-bind('windowSizeInCssForRef'));
  192. background: #549E7E;
  193. }
  194. }
  195. }
  196. }
  197. </style>