-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
59 lines (54 loc) · 1.67 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script type="module" src="/src/index.ts"></script>
<link rel="stylesheet" href="./src/simple.min.css">
<title>Mahgen</title>
</head>
<body>
<header>
<h1>Mahgen</h1>
<p>Mahjong Image Generator</p>
</header>
<main>
<input type="text" name="seq" id="seq" placeholder="Input Mahjong Sequence Here..." style="width: 100%" />
<input type="checkbox" id="checkbox" value="terms">River Mode</input>
<button id="btn" style="width: 100%">Generate!</button>
<figure style="text-align: center">
<mah-gen id="tile" data-seq="7z" data-show-err></mah-gen>
</figure>
</main>
<footer>
<p>Mahgen was created by <a href="https://github.com/eric200203" target="_blank">Eric Lee</a> and is licensed under the MIT license.</p>
</footer>
</body>
<script type="application/javascript">
function render() {
/**
* @type {MahgenElement}
*/
const img = document.querySelector('#tile');
/**
* @type {HTMLInputElement}
*/
const checkbox = document.querySelector('#checkbox');
if(checkbox.checked) {
img.setAttribute('data-river-mode', 'true');
} else {
img.removeAttribute('data-river-mode');
}
/**
* @type {HTMLInputElement}
*/
const it = document.querySelector('#seq');
img.setAttribute('data-seq', it.value);
}
/**
* @type {HTMLButtonElement}
*/
const button = document.querySelector('#btn');
button.addEventListener('click', render);
</script>
</html>