/
index.js
63 lines (63 loc) · 1.37 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
// クリックしてアニメーションのスピードが上がっていく作例
LottieInteractivity.create({
player: "#lottie", // lottie-playerに追加したid
mode: "chain",
actions: [
// ループ再生
{
state: "loop",
transition: "click", // クリックした時に次のセグメントへ
frames: [0, 61],
},
// 繋ぎのアニメーション
{
state: "autoplay",
transition: "onComplete", // 指定フレームまでの再生終了後、次のセグメントへ
frames: [61, 113],
},
// ループ再生
{
state: "loop",
transition: "click",
frames: [113, 174],
speed: 2, // 倍速に変更してみる
},
// 繋ぎのアニメーション
{
state: "autoplay",
transition: "onComplete",
frames: [174, 217],
speed: 2,
},
{
state: "loop",
transition: "click",
frames: [0, 61],
speed: 3,
},
{
state: "autoplay",
transition: "onComplete",
frames: [61, 100],
speed: 3,
},
{
state: "loop",
transition: "click",
frames: [100, 161],
speed: 4,
},
{
state: "autoplay",
transition: "onComplete",
frames: [161, 217],
speed: 4,
},
{
state: "loop",
transition: "click",
frames: [0, 61],
speed: 7,
},
],
});