mirror of
https://github.com/pyscript/pyscript.git
synced 2026-02-14 10:01:09 -05:00
39 lines
1.3 KiB
HTML
39 lines
1.3 KiB
HTML
<!doctype html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
|
|
<title>python</title>
|
|
<script>
|
|
navigator.serviceWorker.register("../sw.js");
|
|
</script>
|
|
<link rel="manifest" href="manifest.json" />
|
|
<link rel="stylesheet" href="style.css" />
|
|
<script defer src="./counter.js"></script>
|
|
<script type="module" src="../min.js"></script>
|
|
<script type="module">
|
|
customElements.define(
|
|
"shadow-dom",
|
|
class extends HTMLElement {
|
|
constructor() {
|
|
const sd = super().attachShadow({ mode: "closed" });
|
|
sd.appendChild(
|
|
Object.assign(document.createElement("script"), {
|
|
type: "micropython",
|
|
textContent: `
|
|
import sys
|
|
import js
|
|
js.document.currentScript.target.textContent = sys.version
|
|
`,
|
|
}),
|
|
);
|
|
}
|
|
},
|
|
);
|
|
</script>
|
|
</head>
|
|
<body>
|
|
<shadow-dom></shadow-dom>
|
|
</body>
|
|
</html>
|