home.vue 2.9 KB

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