-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbasic.html
More file actions
30 lines (30 loc) · 1.3 KB
/
Copy pathbasic.html
File metadata and controls
30 lines (30 loc) · 1.3 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>ournotes-player: basic</title>
<style>
body { margin: 0; padding: 16px; background: #111; color: #ddd; font: 14px/1.5 system-ui, sans-serif; }
ournotes-player { max-width: 960px; margin: 0 auto; }
p { max-width: 960px; margin: 12px auto; }
code { color: #9cf; }
</style>
<!-- Served from the repository root. With the npm package: import "ournotes-player/element"; from a CDN:
dist/ournotes-player.element.min.js -->
<script type="module" src="../src/element.js"></script>
</head>
<body>
<ournotes-player id="player" controls></ournotes-player>
<p>Chart manifest: <code id="src"></code>. Pass another one as <code>?src=<manifest URL></code>.</p>
<script type="module">
const src = new URLSearchParams(location.search).get("src") || "../site/charts/100001_expert.json";
const el = document.getElementById("player");
document.getElementById("src").textContent = src;
el.addEventListener("ready", () => { if (el.chart && el.chart.title) document.title = el.chart.title; });
el.addEventListener("ended", () => console.log("ended at", el.currentTime, "ms"));
el.addEventListener("error", (e) => console.error(e.detail.error));
el.src = src;
</script>
</body>
</html>