-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.html
90 lines (88 loc) · 4.01 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
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>CSS3 Beziér curve animation generator</title>
<style>
* { padding: 0; margin: 0; box-sizing: border-box; }
html, body { height: 100%; }
html, input, select { font: normal 12px Tahoma;}
#container, #container canvas { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
#container .node {
position: absolute; width: 10px; height: 10px;
border-radius: 10px;
background: green;
border: 1px solid rgba(0,0,0,0.5);
box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
cursor: pointer;
}
#container .node span { position: relative; top: 10px; }
#container input { width: 5em; }
#container .params { position: fixed; top: 20px; left: 20px; z-index: 10; border-image: url(images/box.png) 10 10 10 10 fill repeat; border-width: 10px; }
#container textarea { font: normal 11px Consolas; width: 38em; height: 25em; padding: 0.8em; }
#animatable { width: 64px; height: 64px; position: absolute; left: 50%; top: 50%; margin-left: -32px; margin-top: -32px; pointer-events: none; background: url(images/box.png) center no-repeat; display: none; z-index: 11;}
footer {
position: fixed; right: 10px; bottom: 10px; max-width: 300px;
padding: 5px;
background: rgba(200,180,180,0.5);
}
</style>
</head>
<body>
<div id="container">
<canvas></canvas>
<div class="params">
<table>
<tr>
<th>A</th>
<td><input name="Ax"/></td>
<td><input name="Ay"/></td>
<th>B</th>
<td><input name="Bx"/></td>
<td><input name="By"/></td>
</tr>
<tr>
<th>C</th>
<td><input name="Cx"/></td>
<td><input name="Cy"/></td>
<th>D</th>
<td><input name="Dx"/></td>
<td><input name="Dy"/></td>
</tr>
</table>
<table>
<tr>
<th>Animation length</th>
<td><input name="anim_length" value="1"/> s</td>
</tr>
<tr>
<th>Easing</th>
<td>
<select name="easing">
<option value="linear">linear</option>
<option value="ease-in">ease in</option>
<option value="ease-out">ease out</option>
<option value="ease-in-out">ease in-out</option>
</select>
</td>
</tr>
<tr>
<th/>
<td><button data-action="run">Run animation</button></td>
</tr>
</table>
<textarea class="generated"></textarea>
</div>
<div id="animatable"></div>
</div>
<footer>
<p>Lovingly crafted by <a href="//krofdrakula.github.io/">Klemen</a>. The code is available under MIT license on GitHub: <a href="/~https://github.com/KrofDrakula/css-animation-bezier">download, fork, contribute!</a>. Share the love! <3</p>
</footer>
<script src="//code.jquery.com/jquery-1.11.2.min.js"></script>
<script src="//code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script src="//code.jquery.com/ui/1.9.0/jquery-ui.min.js"></script>
<script src="curves.js"></script>
<script src="ui.js"></script>
<script src="main.js"></script>
</body>
</html>