-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
24 lines (23 loc) · 1004 Bytes
/
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
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>code-viewer</title>
<script src="https://zavx0z.github.io/dev-tools/index.js" type="module" async></script>
<dev-tools mobile></dev-tools>
<script type="module" async>
const url = "https://zavx0z.github.io/code-viewer/index.js"
const tagname = url.match(/\.github\.io\/(.*?)\//)[1]
await import("./index.js")
import { nodeFabric } from "./utils.js"
const actor = document.createElement(tagname)
let persistence = localStorage.getItem("code-viewer")
persistence && (actor.state = JSON.parse(persistence))
actor.subscribe((snapshot) => localStorage.setItem("code-viewer", JSON.stringify(snapshot)))
const content = nodeFabric(actor)
console.log(content)
document.body.appendChild(content)
</script>
</head>
<body style="background-color: #1b2634; color: aqua"></body>
</html>