homePage.vue 2.1KB

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