-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgen.html
47 lines (42 loc) · 2.5 KB
/
gen.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
<!DOCTYPE html>
<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">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<title>Name Colours generate</title>
</head>
<body class="dark" style="overflow: visible; user-select: auto; padding: 20px; color: #fff; background: #000">
<br><label class="overl">namecol:load</label>
<div id="text_load"></div>
<br><label class="overl">namecol:ui/set</label>
<div id="text_set"></div>
</body>
<script>
let text_load = '';
let text_set = '';
let colours = ['red','gold','yellow','green','dark_green','dark_aqua','aqua','blue','dark_blue','dark_purple','dark_red','light_purple','white','gray','dark_gray','black'];
let pronouns = ['','he_him','she_her','they_them','he_they','she_they','it_its','he_it','she_it','they_it','he_she_they','any','by_name','neo','he_she','she_he'];
for (let colour in colours) {
for (let pronoun in pronouns) {
// special case for no pronoun
if (pronouns[pronoun] == '') {
text_load = `${text_load}<br>## ${colours[colour]}<br>
team add clover.${colours[colour]}<br>
team modify clover.${colours[colour]} color ${colours[colour]}<br>`;
text_set = `${text_set}<br>## ${colours[colour]}<br>
execute if score @s clover.colour matches ${parseInt(colour) + 2} if score @s clover.pronoun matches 30 run team join clover.${colours[colour]}<br>`;
} else {
// pronouns
text_load = `${text_load}## ${colours[colour]} (${pronouns[pronoun]})<br>
team add clover.${colours[colour]}_${pronouns[pronoun]}<br>
team modify clover.${colours[colour]}_${pronouns[pronoun]} color ${colours[colour]}<br>
team modify clover.${colours[colour]}_${pronouns[pronoun]} suffix {"text":" • ${pronouns[pronoun].replaceAll('_','/')}","color":"gray"}<br>`;
text_set = `${text_set}## ${colours[colour]} (${pronouns[pronoun]})<br>
execute if score @s clover.colour matches ${parseInt(colour) + 2} if score @s clover.pronoun matches ${parseInt(pronoun) + 30} run team join clover.${colours[colour]}_${pronouns[pronoun]}<br>`;
}
}
}
document.getElementById('text_load').innerHTML = text_load;
document.getElementById('text_set').innerHTML = text_set;
</script>