home.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  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="/img/show_banner.png"
  15. />
  16. <img
  17. class="carousel-img"
  18. style="width: 100%; height: 100%; object-fit: cover"
  19. src="/img/show_banner.png"
  20. />
  21. <img
  22. class="carousel-img"
  23. style="width: 100%; height: 100%; object-fit: cover"
  24. src="/img/show_banner.png"
  25. />
  26. <img
  27. class="carousel-img"
  28. style="width: 100%; height: 100%; object-fit: cover"
  29. src="/img/show_banner.png"
  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-border: 10px;
  69. --main-right-bg-img: url("img/h_banner_bg.png");
  70. --main-right-bg-btn1: url("/img/guide_1.png");
  71. --main-right-bg-btn2: url("/img/guide_2.png");
  72. --main-right-bg-btn3: url("/img/guide_3.png");
  73. --main-right-bg-btn4: url("/img/guide_4.png");
  74. --main-right-bg-btn5: url("/img/guide_5.png");
  75. --main-navigate-btn-width: 11.3125rem;
  76. --main-navigate-btn-height: 6.3125rem;
  77. }
  78. </style>
  79. <style lang="scss" scoped>
  80. .main {
  81. width: 100%;
  82. height: 100%;
  83. display: flex;
  84. flex-direction: row;
  85. }
  86. .left {
  87. flex: 1 1 70%;
  88. background-color: var(--main-home-left-background);
  89. }
  90. .right {
  91. flex: 0 0 416px;
  92. width: 416px;
  93. // background-color: var(--main-home-right-background);
  94. border-top: var(--main-right-border) solid var(--main-home-right-background);
  95. border-bottom: var(--main-right-border) solid
  96. var(--main-home-right-background);
  97. background-image: var(--main-right-bg-img);
  98. background-size: cover;
  99. background-repeat: no-repeat;
  100. background-position: bottom right;
  101. display: flex;
  102. align-items: center;
  103. justify-content: center;
  104. flex-direction: column;
  105. position: relative;
  106. .home_logo {
  107. position: absolute;
  108. top: 0;
  109. left: 0;
  110. width: 100%;
  111. display: flex;
  112. align-items: center;
  113. justify-content: center;
  114. img {
  115. display: block;
  116. margin-top: 46px;
  117. height: 4.5rem;
  118. }
  119. }
  120. .navigate {
  121. margin-top: 30px;
  122. width: calc(var(--main-navigate-btn-width) * 2 + 16px);
  123. }
  124. :deep(.btn) {
  125. color: transparent;
  126. width: var(--main-navigate-btn-width);
  127. height: var(--main-navigate-btn-height);
  128. background-size: contain;
  129. background-repeat: no-repeat;
  130. padding: 0;
  131. margin: 0;
  132. &:hover {
  133. border: none;
  134. }
  135. &.btn_1 {
  136. background-image: var(--main-right-bg-btn1);
  137. }
  138. &.btn_2 {
  139. background-image: var(--main-right-bg-btn2);
  140. }
  141. &.btn_3 {
  142. background-image: var(--main-right-bg-btn3);
  143. }
  144. &.btn_4 {
  145. background-image: var(--main-right-bg-btn4);
  146. }
  147. &.btn_5 {
  148. background-image: var(--main-right-bg-btn5);
  149. }
  150. }
  151. }
  152. :deep(.n-carousel .n-carousel__dots.n-carousel__dots--dot .n-carousel__dot) {
  153. width: 3.25rem;
  154. border-radius: 10px;
  155. --n-dot-color: #c5c5c5;
  156. --n-dot-color-active: var(--main-primary-color);
  157. }
  158. </style>