homePage.vue 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. <template>
  2. <div>
  3. <!-- :style="HomeStyle" -->
  4. <BackPage>
  5. <!-- <img :src="backHome" class="bg-image" /> -->
  6. <div class="TitleBox">
  7. <img :src="gameTitle" />
  8. </div>
  9. <div class="bth-div">
  10. <!-- <img src="../assets/index/开始游戏.png" class="bth-image" /> -->
  11. <img :src="gameSatrt" class="bth-image" @click="linkTo" />
  12. <img :src="gameRule" class="bth-image" @click="goRule" />
  13. </div>
  14. </BackPage>
  15. </div>
  16. </template>
  17. <script >
  18. import { useRouter } from 'vue-router'
  19. import backHome from '../assets/BackImage/backHome.jpg'
  20. import gameTitle from '../assets/BackImage/首页大标.png'
  21. import gameSatrt from '../assets/ButtonImage/开始游戏.png'
  22. import gameRule from '../assets/ButtonImage/游戏规则.png'
  23. // import BackPage from './componentsPages/BackPage.vue'
  24. export default {
  25. setup() {
  26. const router = useRouter()
  27. const HomeStyle = {
  28. backgroundImage:
  29. 'url(' + require('../assets/BackImage/backHome.jpg') + ')',
  30. backgroundRepeat: 'no-repeat',
  31. backgroundSize: '100% auto'
  32. }
  33. const linkTo = () => {
  34. // 字符串路径
  35. // router.push('/about')
  36. // 带有路径的对象
  37. router.push({
  38. path: '/OverPage',
  39. query: {
  40. type: 'win'
  41. }
  42. })
  43. }
  44. const goRule = () => {
  45. // 字符串路径
  46. // router.push('/about')
  47. // 带有路径的对象
  48. router.push({
  49. path: '/TopRulePage',
  50. query: {
  51. // type: 'top'
  52. type: 'rule'
  53. }
  54. })
  55. }
  56. return {
  57. HomeStyle,
  58. linkTo,
  59. backHome,
  60. gameSatrt,
  61. gameRule,
  62. gameTitle,
  63. goRule
  64. }
  65. }
  66. }
  67. </script>
  68. <style lang="less" scoped>
  69. // @keyframes scaleDraw {
  70. // 0% {
  71. // transform: scale(0.2);
  72. // }
  73. // 50% {
  74. // transform: scale(1.1);
  75. // }
  76. // 100% {
  77. // transform: scale(1);
  78. // }
  79. // }
  80. @keyframes scaleDraw {
  81. 0% {
  82. transform: scale(0.9);
  83. }
  84. 25% {
  85. transform: scale(1.1);
  86. }
  87. 45% {
  88. transform: scale(0.9);
  89. }
  90. 75% {
  91. transform: scale(1);
  92. }
  93. }
  94. .TitleBox {
  95. width: 99%;
  96. position: absolute;
  97. top: 15vh;
  98. display: flex;
  99. justify-content: center;
  100. animation: scaleDraw 1.4s ease-out 1;
  101. > img {
  102. width: 85%;
  103. height: 100%;
  104. }
  105. }
  106. .bg-image {
  107. // width: 100%;
  108. width: 100vw;
  109. }
  110. .bth-div {
  111. width: 33vw;
  112. position: absolute;
  113. top: 80vh;
  114. left: 35vw;
  115. display: flex;
  116. justify-content: center;
  117. .bth-image {
  118. width: 100%;
  119. }
  120. }
  121. </style>