home.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <script setup lang="ts">
  2. import { useRouter } from "vue-router"
  3. const name = ref("广明弥勒养殖")
  4. const router = useRouter()
  5. onMounted(() => {
  6. // 如果是移动设备,跳转到移动端主页
  7. if (isMobile()) {
  8. router.replace("/m-home")
  9. return
  10. }
  11. document.querySelector("body")?.classList.add("is-home")
  12. })
  13. onBeforeUnmount(() => {
  14. document.querySelector("body")?.classList.remove("is-home")
  15. })
  16. </script>
  17. <template>
  18. <div class="home-page">
  19. <div class="inner-header">
  20. <span class="title">
  21. <span class="me-5 fw-bold">{{ name }}</span>
  22. <small>系统管理平台</small>
  23. </span>
  24. </div>
  25. <!--Waves Container-->
  26. <div class="waves-box">
  27. <svg
  28. class="waves"
  29. xmlns="http://www.w3.org/2000/svg"
  30. xmlns:xlink="http://www.w3.org/1999/xlink"
  31. viewBox="0 24 150 28"
  32. preserveAspectRatio="none"
  33. shape-rendering="auto">
  34. <defs>
  35. <path
  36. id="gentle-wave"
  37. d="M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z" />
  38. </defs>
  39. <g class="parallax">
  40. <use xlink:href="#gentle-wave" x="48" y="0" fill="rgba(255,255,255,0.7" />
  41. <use xlink:href="#gentle-wave" x="48" y="3" fill="rgba(255,255,255,0.5)" />
  42. <use xlink:href="#gentle-wave" x="48" y="5" fill="rgba(255,255,255,0.3)" />
  43. <use xlink:href="#gentle-wave" x="48" y="7" fill="rgba(255,255,255,0.9)" />
  44. </g>
  45. </svg>
  46. </div>
  47. <!--Waves end-->
  48. <div class="footer"></div>
  49. </div>
  50. </template>
  51. <style lang="scss">
  52. .home-page {
  53. width: 100%;
  54. height: calc(100vh - 105px);
  55. position: relative;
  56. text-align: center;
  57. background: linear-gradient(60deg, rgba(54, 58, 183, 1) 0, rgba(0, 172, 193, 1) 100%);
  58. color: white;
  59. .inner-header {
  60. height: 65%;
  61. width: 100%;
  62. margin: 0;
  63. padding: 0;
  64. display: flex;
  65. justify-content: center;
  66. align-items: center;
  67. text-align: center;
  68. .title {
  69. font-family: "Lato", sans-serif;
  70. font-weight: 300;
  71. letter-spacing: 2px;
  72. font-size: 68px;
  73. color: white;
  74. small {
  75. font-size: 80%;
  76. color: #eee;
  77. }
  78. }
  79. }
  80. .waves-box {
  81. width: 100%;
  82. height: 15%;
  83. min-height: 100px;
  84. max-height: 150px;
  85. .waves {
  86. width: 100%;
  87. height: 100%;
  88. }
  89. }
  90. /* Animation */
  91. .parallax {
  92. & > use {
  93. animation: move-forever 25s cubic-bezier(0.55, 0.5, 0.45, 0.5) infinite;
  94. }
  95. & > use:nth-child(1) {
  96. animation-delay: -2s;
  97. animation-duration: 7s;
  98. }
  99. & > use:nth-child(2) {
  100. animation-delay: -3s;
  101. animation-duration: 10s;
  102. }
  103. & > use:nth-child(3) {
  104. animation-delay: -4s;
  105. animation-duration: 13s;
  106. }
  107. & > use:nth-child(4) {
  108. animation-delay: -5s;
  109. animation-duration: 20s;
  110. }
  111. }
  112. .footer {
  113. position: relative;
  114. height: 22%;
  115. text-align: center;
  116. background-color: white;
  117. margin-top: -15px;
  118. }
  119. }
  120. @keyframes move-forever {
  121. 0% {
  122. transform: translate3d(-90px, 0, 0);
  123. }
  124. 100% {
  125. transform: translate3d(85px, 0, 0);
  126. }
  127. }
  128. @media (min-width: 991.98px) {
  129. .home-page {
  130. height: calc(100vh - 134px);
  131. }
  132. }
  133. /*Shrinking for mobile*/
  134. @media (max-width: 768px) {
  135. .home-page {
  136. .waves {
  137. height: 40px;
  138. min-height: 40px;
  139. }
  140. .title {
  141. font-size: 24px;
  142. }
  143. }
  144. }
  145. </style>