张延森 3 jaren geleden
bovenliggende
commit
25bc0592c4
1 gewijzigde bestanden met toevoegingen van 68 en 1 verwijderingen
  1. 68
    1
      src/components/LeftGrass.vue

+ 68
- 1
src/components/LeftGrass.vue Bestand weergeven

@@ -1,11 +1,17 @@
1 1
 <template>
2 2
   <div class="left-grass-box">
3
-
3
+    <img class="left-grass" :src="grassImage" alt="">
4
+    <img class="flower-motion flower-1" :src="flower1Image" alt="">
5
+    <img class="flower-motion flower-2" :src="flower2Image" alt="">
6
+    <img class="leaf-motion grass-leaf" :src="leafImage" alt="">
4 7
   </div>
5 8
 </template>
6 9
 
7 10
 <script setup>
8 11
 import grassImage from '@/assets/GrassImage/left-grass.png'
12
+import flower1Image from '@/assets/GrassImage/left-flower-1.png'
13
+import flower2Image from '@/assets/GrassImage/left-flower-2.png'
14
+import leafImage from '@/assets/GrassImage/left-leaf-1.png'
9 15
 </script>
10 16
 
11 17
 <style lang="less" scoped>
@@ -14,5 +20,66 @@ import grassImage from '@/assets/GrassImage/left-grass.png'
14 20
   left: 0;
15 21
   bottom: 0;
16 22
   z-index: 0;
23
+  
24
+  & > img {
25
+    position: absolute;
26
+    left: 0;
27
+    bottom: 0;
28
+    will-change: transform;
29
+  }
30
+  
31
+  .flower-motion {
32
+    transform-origin: left bottom;
33
+    animation-name: windblow;
34
+    animation-duration: 6s;
35
+    animation-timing-function: linear;
36
+    animation-iteration-count: infinite;
37
+  }
38
+
39
+  .leaf-motion {
40
+    transform-origin: left bottom;
41
+    animation-name: windblow2;
42
+    animation-duration: 6s;
43
+    animation-timing-function: linear;
44
+    animation-iteration-count: infinite;
45
+  }
46
+  
47
+  @keyframes windblow {
48
+    50% {
49
+      transform: rotate(10deg);
50
+    }
51
+  }
52
+  
53
+  @keyframes windblow2 {
54
+    50% {
55
+      transform: rotate(-8deg);
56
+    }
57
+  }
58
+
59
+  .left-grass {
60
+    width: 52.5vw;
61
+    height: 43.4vw;
62
+  }
63
+
64
+  .flower-1 {
65
+    width: 9.5vw;
66
+    height: 13vw;
67
+    left: 11.5vw;
68
+    bottom: 13.5vw;
69
+  }
70
+
71
+  .flower-2 {
72
+    width: 7.3vw;
73
+    height: 11.2vw;
74
+    left: 32vw;
75
+    bottom: -1vw;
76
+  }
77
+
78
+  .grass-leaf {
79
+    width: 30vw;
80
+    height: 13.4vw;
81
+    left: 10vw;
82
+    bottom: 8.6vw;
83
+  }
17 84
 }
18 85
 </style>