home.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class="main">
  3. <div class="left">
  4. <!-- post -->
  5. <n-carousel
  6. dot-placement="bottom"
  7. style="width: 100%; height: 100%"
  8. autoplay
  9. draggable
  10. >
  11. <img
  12. class="carousel-img"
  13. style="width: 100%; height: 100%; object-fit: cover"
  14. src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel1.jpeg"
  15. />
  16. <img
  17. class="carousel-img"
  18. style="width: 100%; height: 100%; object-fit: cover"
  19. src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel2.jpeg"
  20. />
  21. <img
  22. class="carousel-img"
  23. style="width: 100%; height: 100%; object-fit: cover"
  24. src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel3.jpeg"
  25. />
  26. <img
  27. class="carousel-img"
  28. style="width: 100%; height: 100%; object-fit: cover"
  29. src="https://naive-ui.oss-cn-beijing.aliyuncs.com/carousel-img/carousel4.jpeg"
  30. />
  31. </n-carousel>
  32. </div>
  33. <div class="right">
  34. <div class="home_logo">
  35. <img src="img/logo.png" />
  36. </div>
  37. <n-space class="navigate" justify="flex-start" align="center">
  38. <n-button class="btn btn_1" @click="push('/info')" text>
  39. 场馆资讯</n-button
  40. >
  41. <n-button class="btn btn_2" @click="push('/exhibition')" text>
  42. 展厅导览</n-button
  43. >
  44. <n-button class="btn btn_3" @click="push('/collect')" text>
  45. 馆藏精品
  46. </n-button>
  47. <n-button class="btn btn_4" @click="push('/survey')" text>
  48. 问卷调查</n-button
  49. >
  50. <n-button class="btn btn_5" @click="push('/feedback')" text>
  51. 留言反馈</n-button
  52. >
  53. </n-space>
  54. </div>
  55. </div>
  56. </template>
  57. <script setup>
  58. import { useFullscreen } from "@vueuse/core";
  59. import { useRoute, useRouter } from "vue-router";
  60. const { push } = useRouter();
  61. const { isFullscreen, enter, exit, toggle } = useFullscreen();
  62. // console.log("isFullscreen", isFullscreen);
  63. </script>
  64. <style>
  65. .main {
  66. --main-home-left-background: #e2caa3;
  67. --main-home-right-background: #910000;
  68. /* --main-right-bg-img: url("img/h_banner_bg.png"); */
  69. --main-right-bg-btn1: url("img/guide_1.png");
  70. --main-right-bg-btn2: url("img/guide_2.png");
  71. --main-right-bg-btn3: url("img/guide_3.png");
  72. --main-right-bg-btn4: url("img/guide_4.png");
  73. --main-right-bg-btn5: url("img/guide_5.png");
  74. --main-navigate-btn-width: 11.3125rem;
  75. --main-navigate-btn-height: 6.3125rem;
  76. }
  77. </style>
  78. <style lang="scss" scoped>
  79. .main {
  80. width: 100%;
  81. height: 100%;
  82. display: flex;
  83. flex-direction: row;
  84. }
  85. .left {
  86. flex: 1 1 70%;
  87. background-color: var(--main-home-left-background);
  88. }
  89. .right {
  90. flex: 0 0 416px;
  91. width: 416px;
  92. background-color: var(--main-home-right-background);
  93. background-image: var(--main-right-bg-img);
  94. background-size: contain;
  95. background-repeat: no-repeat;
  96. display: flex;
  97. align-items: center;
  98. justify-content: center;
  99. flex-direction: column;
  100. position: relative;
  101. .home_logo {
  102. position: absolute;
  103. top: 0;
  104. left: 0;
  105. width: 100%;
  106. display: flex;
  107. align-items: center;
  108. justify-content: center;
  109. img {
  110. display: block;
  111. margin-top: 46px;
  112. height: 4.5rem;
  113. }
  114. }
  115. .navigate {
  116. margin-top: 30px;
  117. width: calc(var(--main-navigate-btn-width) * 2 + 16px);
  118. }
  119. :deep(.btn) {
  120. color: transparent;
  121. width: var(--main-navigate-btn-width);
  122. height: var(--main-navigate-btn-height);
  123. background-size: contain;
  124. background-repeat: no-repeat;
  125. padding: 0;
  126. margin: 0;
  127. &:hover {
  128. border: none;
  129. }
  130. &.btn_1 {
  131. background-image: var(--main-right-bg-btn1);
  132. }
  133. &.btn_2 {
  134. background-image: var(--main-right-bg-btn2);
  135. }
  136. &.btn_3 {
  137. background-image: var(--main-right-bg-btn3);
  138. }
  139. &.btn_4 {
  140. background-image: var(--main-right-bg-btn4);
  141. }
  142. &.btn_5 {
  143. background-image: var(--main-right-bg-btn5);
  144. }
  145. }
  146. }
  147. </style>