File tree 2 files changed +11
-3
lines changed
2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,8 @@ let arr = new Array(7).fill(0).map(it => ({
9
9
y: 1 ,
10
10
}))
11
11
12
- arr .forEach ((it , i ) => {
12
+ function startAnimation() {
13
+ arr .forEach ((it , i ) => {
13
14
gsap .timeline ({
14
15
defaults: {
15
16
duration: 0.4 * (i + 1 ),
@@ -29,7 +30,15 @@ arr.forEach((it, i) => {
29
30
.to (it , { y: 0 , ease: ' sine.out' })
30
31
.to (it , { y: 1 , ease: ' sine.in' }).repeat (- 1 )
31
32
})
33
+ }
32
34
35
+ if (' requestIdleCallback' in window ) {
36
+ window .requestIdleCallback (startAnimation );
37
+ } else {
38
+ setTimeout (() => {
39
+ startAnimation ()
40
+ }, 300 );
41
+ }
33
42
function blendColors(color1 , color2 ) {
34
43
// 将 HEX 转换为 RGB
35
44
const rgb1 = parseInt (color1 .slice (1 ), 16 );
Original file line number Diff line number Diff line change 1
1
import { createApp } from 'vue'
2
- import MyComponent from '../src/index'
3
2
import './main.css'
4
3
import 'virtual:uno.css'
5
4
import App from './App.vue'
6
5
7
- createApp ( App ) . use ( MyComponent ) . mount ( '#app' )
6
+ createApp ( App ) . mount ( '#app' )
You can’t perform that action at this time.
0 commit comments