-
-
Notifications
You must be signed in to change notification settings - Fork 49
/
index.html
62 lines (54 loc) · 1.25 KB
/
index.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>mo · js player</title>
<!-- <link rel="stylesheet" type="text/css" href="css/main.css"> -->
</head>
<body>
<style>
:root {
/*font-size: 16px;*/
line-height: 1.7;
}
body {
background-color: #333;
}
.el {
width: 100px;
height: 100px;
background: cyan;
}
</style>
<div class="el" id="js-el"></div>
<br />
<br />
<br />
<br />
<br />
<script src="node_modules/@mojs/core/build/mo.js"></script>
<script src="build/mojs-player.js"></script>
<script>
var el = document.querySelector( '#js-el' );
var tw = new mojs.Tween({
duration: 4000,
onUpdate (p) {
// console.log(p);
el.style.transform = `translateX(${ 1000 * p }px) translateZ(0)`;
}
});
// var tm = new mojs.Timeline;
// tm.add(tw);
var mojsPlayer = new MojsPlayer({
add: tw,
isPlaying: true,
// progress: .5,
speed: 1,
// precision: .5,
name: 'player1'
// className: 'lalal'
// isSaveState: false
});
</script>
</body>
</html>