@@ -17,10 +17,12 @@ withDefaults(defineProps<WaterfallProperties>(), {
1717 </script >
1818
1919<style lang="scss" scoped>
20+ $waterfall-width : 200px ;
21+
2022.waterfall {
2123 overflow : hidden ;
2224 position : relative ;
23- width : 300 px ;
25+ width : $waterfall-width ;
2426 height : 100% ;
2527
2628 & .heartbeat {
@@ -59,19 +61,23 @@ withDefaults(defineProps<WaterfallProperties>(), {
5961
6062 & .lava {
6163 background : linear-gradient (180deg , #5968F4 , #5d80fc , #5968F4 );
64+ // display: flex;
65+ // flex-direction: column;
66+ // align-items: center;
6267 background-size : 100% 100vh ;
63- animation : 3s linear rectangle infinite ;
6468 & ::after {
6569 position : absolute ;
66- content : " " ;
6770 top : 0 ;
68- left : 10% ;
69- right : 0 ;
70- bottom : 75% ;
71+ left : 0 ;
72+ width : 200px ;
73+ height : 200px ;
74+ content : " " ;
7175 background : linear-gradient (180deg , rgba (255 , 101 , 101 , 0.00 ) 0% , #69adfa 100% );
72- border-radius : 100% 0 0 100% ;
76+ // border-radius: 100% 0 0 100%;
77+ border-radius : 100% ;
7378 background-blend-mode : color-burn ;
74- animation : 40s linear rectangle- item infinite alternate ;
79+ animation : 30s linear rectangle- item infinite alternate ;
80+ will-change : transform , border-radius ;
7581 }
7682 }
7783
@@ -114,70 +120,41 @@ withDefaults(defineProps<WaterfallProperties>(), {
114120
115121@keyframes waterfall {
116122 from {
117- top : -50% ;
118- bottom : 100% ;
123+ transform : translateY (0% )
119124 }
120125 to {
121- top : 100% ;
122- bottom : -50% ;
126+ transform : translateY (calc (100vh + 300px ))
123127 }
124128}
125129
126130@keyframes circle {
127131 from {
128- right : 0 ;
132+ transform : translateX ( 0 )
129133 }
130134 to {
131- right : 100% ;
132- }
133- }
134-
135- @keyframes rectangle {
136- from {
137- background-position-y :0 ;
138- }
139- to {
140- background-position-y : 100vh ;
135+ transform : translateX (- $waterfall-width )
141136 }
142137}
143138
144139@keyframes rectangle-item {
145140 from {
146- border-radius : 100% 0 0 100% ;
147- left : 10% ;
148- right : 0 ;
149-
150- top : -25% ;
151- bottom : 100% ;
141+ scale : 1 ;
152142 }
153143 33% {
154- top : 100% ;
155- bottom : -25% ;
156-
157- border-radius : 0 100% 100% 0 ;
158- left : 0 ;
159- right : 10% ;
144+ transform : skew (2deg );
160145 }
161- 34 % {
162- left : 10 % ;
163- right : 0 ;
164- border-radius : 100 % 0 0 100 % ;
146+ 50 % {
147+ rotate : 180 deg ;
148+ transform : skewX ( 3 deg ) skewY ( 5 deg ) ;
149+ scale : 0.88 ;
165150 }
166151 66% {
167- top : -25% ;
168- bottom : 100% ;
169-
170- border-radius : 0 100% 100% 0 ;
171- left : 0 ;
172- right : 10% ;
152+ transform : skew (17deg );
173153 }
174154 to {
175- top : 100% ;
176- bottom : -25% ;
177-
178- border-radius : 100% 0 0 100% ;
179- left : 10% ;
180- right : 0 ;
155+ translate : 0 calc (100vh - 300px );
156+ transform : skew (8deg );
157+ scale : 1 ;
181158 }
182159}
183160
0 commit comments