forked from vector-js/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmath.html
More file actions
44 lines (39 loc) · 1.07 KB
/
math.html
File metadata and controls
44 lines (39 loc) · 1.07 KB
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
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Examples</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
<style>
body {
margin: 16px;
}
div {
margin-bottom:16px
}
</style>
<!-- STYLESHEET -->
<link rel="stylesheet" href="/css/library.css">
<!-- CURRENT INTERACTIVE -->
<div id="unit-circle">
<script type="module">
import main from "./dist/examples/math/unit-circle.js";
main("unit-circle");
</script>
</div>
<script type="module">
import { download } from './dist/util/file.js';
// add a save function to the window to save the current interactive
window.save = function() {
let interactives = document.getElementsByClassName('interactive');
for( let i = 0; i < interactives.length; i++ ) {
let name = interactives[i].parentElement.id;
let id = interactives[i].id;
download(id, `${name}.svg`);
}
}
</script>
</body>
</html>