-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
51 lines (48 loc) · 2.93 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Word Generator</title>
</head>
<body>
<article id="myContainer">
<h1>Word Generator</h1>
<h3>Amount of syllables</h3>
<div id="buttons">
<button onclick="syllables(1)" id="b1">1</button>
<button onclick="syllables(2)" id="b2">2</button>
<button onclick="syllables(3)" id="b3">3</button>
<button onclick="syllables(4)" id="b4+">4+</button>
<button onclick="syllables(0)" id="br">Random</button>
</div>
<button id="run" onclick="generateAWord()">Generate a Word</button>
<div><p id="Word"></p></div>
<p id="howToRead">How to read <svg width="16" height="12"><path d="M 0 2 L7 10 L14 2" style="stroke:#000; fill:none"/></svg></p>
<div id="rules">
<ul>
<li>a</li>
<li>e</li>
<li>i</li>
<li>o</li>
<li>u</li>
<li>ee</li>
<li>iu</li>
</ul>
</div>
</article>
<script>
var startcons = [' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'h', 'l', 'r', 'y', 'w',' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'h', 'l', 'r', 'y', 'w',' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'h', 'l', 'r', 'y', 'w', 'pl', 'kl', 'bl', 'gl', 'br', 'tr', 'dr', 'kr', 'gr', 'tw', 'dw', 'gw', 'kw', 'pw', 'fl', 'sl', 'thl', 'fr', 'shr', 'hw', 'sw', 'thw', 'vw', 'sp', 'st', 'sk', 'sm', 'sn', 'sf', 'sth', 'spl', 'skl', 'spr', 'str', 'skw', 'sfr'];
var endcons = [' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'l', 'r', 'y',' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'l', 'r', 'y',' ','t', 'd', 's','m','n','p','b','ch','zh','k','g','f','v','th','z', 'j', 'l', 'r', 'y', 'lp', 'lb', 'lt', 'ld', 'lch', 'lj', 'lzh', 'lk', 'rp', 'rb', 'rt', 'rd', 'rch', 'rj', 'rzh', 'rk', 'rg', 'lf', 'lv', 'lth', 'ls', 'lz', 'rf', 'rv', 'rth', 'rs', 'rz', 'rsh', 'lm', 'ln', 'rm', 'rn', 'rl', 'mp', 'nt', 'nd', 'nch', 'nj', 'nzh', 'nk', 'mf', 'mth', 'nth', 'ns', 'nz', 'ngth', 'ft', 'sp', 'st', 'sk', 'fth', 'pt', 'kt', 'pth', 'ps', 'tth', 'dth', 'ts', 'ks', 'lpt', 'lps', 'lts', 'lst', 'lfth', 'lkt', 'lks', 'rmth', 'rpt', 'rps', 'rts', 'rst', 'rkt', 'mpt', 'mps', 'ndth', 'nkt', 'nks', 'nkth', 'ksth', 'kst', 'bl', 'ml', 'mbl', 'pl', 'kl', 'gl', 'pr', 'br', 'tr', 'dr', 'kr', 'gr', 'spl', 'skl', 'mpl', 'spr', 'str', 'skr', 'sfr'];
var vowels = ['ii','i','u','iu','ey','ou','ie','ea','a','o','aw','e','ay','oy','au'];
function GetASyllable(){
return (startcons[Math.floor(Math.random() * startcons.length)]+vowels[Math.floor(Math.random() * vowels.length)]+endcons[Math.floor(Math.random() * endcons.length)]);
}
document.getElementById('Word').innerHTML = GetASyllable();
function generateAWord(){
document.getElementById('Word').innerHTML = GetASyllable();
}
</script>
</body>
</html>