-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
66 lines (52 loc) · 1.34 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>TemPaste Parser</title>
<link rel="stylesheet" href="demo/style.css">
</head>
<body>
<header>
<h1>TemPaste Parsing Demo</h1>
</header>
<div class="input">
<div class="panel">
<h2>Input</h2>
<textarea class="demo-textarea">
</textarea>
</div>
</div>
<div class="output">
<div class="panel">
<h2>Parsed Output</h2>
<pre class="demo-output"></pre>
</div>
</div>
<footer>
<a href="https://github.com/ahejackson/tempaste-parser" target="_blank" rel="noopener noreferrer">
View on GitHub
</a>
</footer>
<script type="module">
import { parsePaste } from './src'
const textarea = document.querySelector(".demo-textarea");
const output = document.querySelector(".demo-output");
const demoText =
`Pigepic @ Fat Burner
Trait: Fainted Curse
Level: 100
TVs: 499 HP / 497 SPD / 3 DEF
- Bamboozle
- Divine Inspiration
- Wind Burst
- Stone Wall
`;
textarea.value = demoText;
output.textContent = JSON.stringify(parsePaste(textarea.value), null, 2);
textarea.addEventListener("input", () => {
output.textContent = JSON.stringify(parsePaste(textarea.value), null, 2);
});
</script>
</body>
</html>