/
timeline_basic.html
50 lines (41 loc) · 1.14 KB
/
timeline_basic.html
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
<!DOCTYPE html>
<html lang="ja">
<head>
<title>実装サンプル ー【GSAP入門】使い方となにができるのか</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="https://kakechimaru.com/wp-content/themes/kakechimaru/image/favicon.ico">
<script src="https://unpkg.com/gsap@3.11.1/dist/gsap.min.js"></script>
<style>
*{
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body{
height: 100%;
}
body{
display: flex;
align-items: center;
justify-content: center;
background-color: #000;
}
.box{
background-color: #fff;
width: 30px;
height: 30px;
}
</style>
</head>
<body>
<div class="box"></div>
<script>
gsap.timeline()
.fromTo('.box', .8, { autoAlpha: 0, y: 30 }, { autoAlpha: 1, y: 0 })
.to('.box', 1, { x: 30 })
.to('.box', .5, { y: 100, rotate: 360 });
</script>
</body>
</html>