-
Notifications
You must be signed in to change notification settings - Fork 1.4k
/
03_graphs.html
101 lines (77 loc) · 3.85 KB
/
03_graphs.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!doctype html>
<html lang="en">
<head>
<title>Tween.js / graphs</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<style>
body {
margin: 0px;
}
#target {
font-size: 13px;
padding: 0px 32px;
}
</style>
<link href="css/style.css" media="screen" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="info" style="position: relative">
<h1><a href="http://github.com/tweenjs/tween.js">tween.js</a></h1>
<h2>03 _ graphs</h2>
<p>The curves, visualised.</p>
</div>
<div id="target"></div>
<script type="module">
import {createGraph} from './js/createGraph.js'
import * as TWEEN from '../dist/tween.esm.js'
const group = new TWEEN.Group()
window.addEventListener('load', function () {
init()
animate()
})
function init() {
const target = document.getElementById('target')
target.appendChild(createGraph(group, 'Linear.None', TWEEN.Easing.Linear.None))
target.appendChild(document.createElement('br'))
target.appendChild(createGraph(group, 'Quadratic.In', TWEEN.Easing.Quadratic.In))
target.appendChild(createGraph(group, 'Quadratic.Out', TWEEN.Easing.Quadratic.Out))
target.appendChild(createGraph(group, 'Quadratic.InOut', TWEEN.Easing.Quadratic.InOut))
target.appendChild(createGraph(group, 'Cubic.In', TWEEN.Easing.Cubic.In))
target.appendChild(createGraph(group, 'Cubic.Out', TWEEN.Easing.Cubic.Out))
target.appendChild(createGraph(group, 'Cubic.InOut', TWEEN.Easing.Cubic.InOut))
target.appendChild(document.createElement('br'))
target.appendChild(createGraph(group, 'Quartic.In', TWEEN.Easing.Quartic.In))
target.appendChild(createGraph(group, 'Quartic.Out', TWEEN.Easing.Quartic.Out))
target.appendChild(createGraph(group, 'Quartic.InOut', TWEEN.Easing.Quartic.InOut))
target.appendChild(createGraph(group, 'Quintic.In', TWEEN.Easing.Quintic.In))
target.appendChild(createGraph(group, 'Quintic.Out', TWEEN.Easing.Quintic.Out))
target.appendChild(createGraph(group, 'Quintic.InOut', TWEEN.Easing.Quintic.InOut))
target.appendChild(document.createElement('br'))
target.appendChild(createGraph(group, 'Sinusoidal.In', TWEEN.Easing.Sinusoidal.In))
target.appendChild(createGraph(group, 'Sinusoidal.Out', TWEEN.Easing.Sinusoidal.Out))
target.appendChild(createGraph(group, 'Sinusoidal.InOut', TWEEN.Easing.Sinusoidal.InOut))
target.appendChild(createGraph(group, 'Exponential.In', TWEEN.Easing.Exponential.In))
target.appendChild(createGraph(group, 'Exponential.Out', TWEEN.Easing.Exponential.Out))
target.appendChild(createGraph(group, 'Exponential.InOut', TWEEN.Easing.Exponential.InOut))
target.appendChild(document.createElement('br'))
target.appendChild(createGraph(group, 'Circular.In', TWEEN.Easing.Circular.In))
target.appendChild(createGraph(group, 'Circular.Out', TWEEN.Easing.Circular.Out))
target.appendChild(createGraph(group, 'Circular.InOut', TWEEN.Easing.Circular.InOut))
target.appendChild(createGraph(group, 'Elastic.In', TWEEN.Easing.Elastic.In))
target.appendChild(createGraph(group, 'Elastic.Out', TWEEN.Easing.Elastic.Out))
target.appendChild(createGraph(group, 'Elastic.InOut', TWEEN.Easing.Elastic.InOut))
target.appendChild(document.createElement('br'))
target.appendChild(createGraph(group, 'Back.In', TWEEN.Easing.Back.In))
target.appendChild(createGraph(group, 'Back.Out', TWEEN.Easing.Back.Out))
target.appendChild(createGraph(group, 'Back.InOut', TWEEN.Easing.Back.InOut))
target.appendChild(createGraph(group, 'Bounce.In', TWEEN.Easing.Bounce.In))
target.appendChild(createGraph(group, 'Bounce.Out', TWEEN.Easing.Bounce.Out))
target.appendChild(createGraph(group, 'Bounce.InOut', TWEEN.Easing.Bounce.InOut))
}
function animate(time) {
requestAnimationFrame(animate)
group.update(time)
}
</script>
</body>
</html>