bgTools.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. <template>
  2. <div class="tools" :style="{ transform: `scale(${scaleVal})` }">
  3. <img class="bg_bottom" src="@/assets/images/bg_tools/bottom.png" alt="" />
  4. <img class="bg_main" src="@/assets/images/bg_tools/main.png" alt="" />
  5. <img class="bg_line1" src="@/assets/images/bg_tools/line1.png" alt="" />
  6. <img class="bg_line2" src="@/assets/images/bg_tools/line2.png" alt="" />
  7. <img class="bg_item1" src="@/assets/images/bg_tools/item1.png" alt="" />
  8. <img class="bg_item2" src="@/assets/images/bg_tools/item2.png" alt="" />
  9. <img class="bg_item3" src="@/assets/images/bg_tools/item3.png" alt="" />
  10. <img class="bg_item4" src="@/assets/images/bg_tools/item4.png" alt="" />
  11. <img class="bg_gear" src="@/assets/images/bg_tools/bg_gear.png" alt="" />
  12. <img class="bg_wrench" src="@/assets/images/bg_tools/bg_wrench.png" alt="" />
  13. </div>
  14. </template>
  15. <script setup>
  16. import { ref, watch } from 'vue'
  17. import { useWindowSize } from '@vueuse/core'
  18. const { width } = useWindowSize()
  19. const scaleVal = ref(1)
  20. watch(
  21. width,
  22. (value) => {
  23. scaleVal.value = value / 1900 < 0.32 ? 0.32 : value / 1900
  24. },
  25. {
  26. immediate: true
  27. }
  28. )
  29. </script>
  30. <style lang="scss" scoped>
  31. .tools {
  32. width: 1124px;
  33. height: 1080px;
  34. position: relative;
  35. .bg_123 {
  36. width: 100%;
  37. height: 100%;
  38. }
  39. .bg_main {
  40. position: absolute;
  41. left: 264px;
  42. top: 160px;
  43. animation: slide-top-down 12s cubic-bezier(0.25, 0.46, 0.45, 0.94) alternate infinite;
  44. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  45. }
  46. .bg_bottom {
  47. position: absolute;
  48. left: 189px;
  49. top: 366px;
  50. animation: scale_bottom 8s linear infinite;
  51. // animation: heartBeat;
  52. // animation-duration: 6s;
  53. // animation-iteration-count: infinite;
  54. }
  55. .bg_line1 {
  56. position: absolute;
  57. left: 210px;
  58. top: 320px;
  59. animation: slide-top-down2 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) -4s alternate infinite;
  60. filter: drop-shadow(4px -4px 12px rgba(18, 108, 242, 0.6));
  61. }
  62. .bg_line2 {
  63. position: absolute;
  64. left: 530px;
  65. top: 243px;
  66. animation: slide-top-down3 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) -4s alternate infinite;
  67. filter: drop-shadow(4px -4px 12px rgba(232, 233, 235, 0.6));
  68. }
  69. .bg_item1 {
  70. position: absolute;
  71. left: 642px;
  72. top: 580px;
  73. animation: bounceInDown;
  74. animation-duration: 2s;
  75. animation-iteration-count: infinite;
  76. animation-direction: alternate;
  77. animation-delay: -0.5s;
  78. filter: drop-shadow(4px -4px 12px rgba(18, 108, 242, 0.6));
  79. }
  80. .bg_item2 {
  81. position: absolute;
  82. left: 840px;
  83. top: 80px;
  84. animation: bounceInDown;
  85. animation-duration: 2s;
  86. animation-iteration-count: infinite;
  87. animation-direction: alternate;
  88. animation-delay: -1s;
  89. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  90. }
  91. .bg_item3 {
  92. position: absolute;
  93. left: 538px;
  94. top: 752px;
  95. animation: bounceInDown;
  96. animation-duration: 2s;
  97. animation-iteration-count: infinite;
  98. animation-direction: alternate;
  99. animation-delay: -1.5s;
  100. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  101. }
  102. .bg_item4 {
  103. position: absolute;
  104. left: 251px;
  105. top: 124px;
  106. animation: bounceInDown;
  107. animation-duration: 2s;
  108. animation-iteration-count: infinite;
  109. animation-direction: alternate;
  110. animation-delay: -2s;
  111. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  112. }
  113. .bg_gear {
  114. width: 28%;
  115. height: 28%;
  116. position: absolute;
  117. right: 80px;
  118. bottom: 280px;
  119. animation: swing;
  120. animation-duration: 12s;
  121. animation-iteration-count: infinite;
  122. animation-direction: alternate;
  123. transform-origin: 45.5% 44%;
  124. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  125. }
  126. .bg_wrench {
  127. width: 48%;
  128. height: 48%;
  129. position: absolute;
  130. left: 24px;
  131. bottom: 100px;
  132. animation: swing;
  133. animation-duration: 12s;
  134. animation-iteration-count: infinite;
  135. animation-direction: alternate;
  136. filter: drop-shadow(0px 0px 12px rgba(18, 108, 242, 0.6));
  137. }
  138. }
  139. @keyframes slide-top-down {
  140. 0% {
  141. transform: translateY(0px);
  142. }
  143. 50% {
  144. transform: translateY(100px);
  145. }
  146. 100% {
  147. transform: translateY(0px);
  148. }
  149. }
  150. @keyframes slide-top-down2 {
  151. 0% {
  152. transform: translateY(0px);
  153. }
  154. 50% {
  155. transform: translateY(80px);
  156. }
  157. 100% {
  158. transform: translateY(0px);
  159. }
  160. }
  161. @keyframes slide-top-down3 {
  162. 0% {
  163. transform: translateY(0px);
  164. }
  165. 50% {
  166. transform: translateY(120px);
  167. }
  168. 100% {
  169. transform: translateY(0px);
  170. }
  171. }
  172. @keyframes scale_bottom {
  173. 0% {
  174. transform: scale(1);
  175. }
  176. 14% {
  177. transform: scale(0.85);
  178. }
  179. 20% {
  180. transform: scale(0.95);
  181. }
  182. 28% {
  183. transform: scale(1.08);
  184. }
  185. 32% {
  186. transform: scale(0.95);
  187. }
  188. 36% {
  189. transform: scale(1.05);
  190. }
  191. 40% {
  192. transform: scale(1.1);
  193. }
  194. 45% {
  195. transform: scale(1.15);
  196. }
  197. 50% {
  198. transform: scale(1.2);
  199. }
  200. 55% {
  201. transform: scale(1.15);
  202. }
  203. 60% {
  204. transform: scale(1.1);
  205. }
  206. 65% {
  207. transform: scale(1);
  208. }
  209. 70% {
  210. transform: scale(1.05);
  211. }
  212. 80% {
  213. transform: scale(0.9);
  214. }
  215. 90% {
  216. transform: scale(0.8);
  217. }
  218. 100% {
  219. transform: scale(1);
  220. }
  221. }
  222. </style>