-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
30 lines (27 loc) · 1.13 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
<html lang="ru">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>skeleton-tracing</title>
<script type="module">
import { pathToImageData, i18n, nodeFabric } from "./utils.js"
await new Promise((res) => import("https://zavx0z.github.io/dev-tools/index.js").then(() => setTimeout(res, 200)))
await import("./index.js")
const { img, imageData } = await pathToImageData("bin.png")
const element = document.querySelector("skeleton-tracing")
element.subscribe((snapshot) => {
const resultSvg = document.getElementById("resultSvg")
const svgEl = new DOMParser().parseFromString(snapshot.svg, "application/xml")
resultSvg.appendChild(resultSvg.ownerDocument.importNode(svgEl.documentElement, true))
})
element.send({ 1701380269254: imageData, preview: true })
const content = nodeFabric(element)
document.body.appendChild(content)
</script>
<dev-tools mobile></dev-tools>
</head>
<body>
<skeleton-tracing></skeleton-tracing>
<div id="resultSvg"></div>
</body>
</html>