-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmod.html
89 lines (89 loc) · 3.83 KB
/
mod.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
player=`<label>Player: </label><input name="name" onblur="roster()"><br><label>Role: </label><input name="role"><br><label>Dead?</label><input type="checkbox" onclick="if (this.checked) {this.parentElement.style.opacity=0.5} else {this.parentElement.style.opacity=''}; roster();"><br><label>Nominations (2=on block):</label><input type="number" min="0" max="2"><br><label>Ability uses: </label><input type="number"><br><label>#Bulletproof: </label><input type="number"><br><label>Info: </label><input><a style="color:#f00;font-size:unset" onclick="this.parentElement.remove()">X</a>`
function visit(p,r) {
return(`<label>Player: </label><input value="${p}" list="live"><br><label>Role: </label><input value="${r}"><br><label>Visit: </label><input list="live"><br><label>Result: </label><input><a style="color:#f00;font-size:unset" onclick="this.parentElement.remove()">X</a>`)
}
function addPlayer() {
let p=document.createElement('div');
p.innerHTML=player;
p.className='entry';
document.getElementById('ppl').appendChild(p);
}
function roster() {
let d=document.getElementById('live');
d.innerHTML='';
for (let _ of document.getElementsByName('name')) {
if (_.parentElement.style.opacity=='') {
d.innerHTML+=`<option value="${_.value}"></option>`
}
}
}
function act(p,r) {
let a=document.createElement('div');
a.innerHTML=visit(p,r);
a.className='entry';
document.getElementById('do').appendChild(a);
}
function actAll() {
for (let i = 0; i < document.getElementsByName('name').length; i++) {
if (document.getElementsByName('name')[i].parentElement.style.opacity=='') {
act(document.getElementsByName('name')[i].value,document.getElementsByName('role')[i].value)
}
}
}
</script>
<style>
.entry {
width: 275px;
border:1px solid #fff;
padding:5px;
border-radius:10px;
display: inline-block;
}
a {
cursor:pointer;
font-size:30px;
}
.container {
width: 600px;
vertical-align:top;
border:5px #888 solid;
padding:5px;
margin:5px;
}
</style>
</head>
<body style="font-family: sans-serif;background:#000;color:#fff;">
<div style="width: unset" class="container">
<h1>General Info</h1>
<div contenteditable="" style="background:#444;padding:10px"></div>
<a style="color: #aaf" onclick="document.getElementsByTagName('dialog')[0].showModal()">Show text to a player</a>
</div>
<div style="display:inline-block" class="container">
<h1>Players</h1>
<a style="color:#0f0" onclick="addPlayer()">+Player</a>
<br>
<a style="color:#f00" onclick="if(confirm('Sure?')){document.getElementById('ppl').innerHTML=''}">Clear</a>
<div id="ppl"></div>
</div>
<div style="display:inline-block" class="container">
<h1>Night Actions</h1>
<a style="color:#0f0" onclick="act('','')">+Visit</a>
<br>
<a style="color:#0f0" onclick="actAll()">+Visit for All Live Players</a>
<br>
<a style="color:#f00" onclick="if(confirm('Sure?')){document.getElementById('do').innerHTML=''}">Clear</a>
<div id="do"></div>
</div>
<datalist id="live"></datalist>
<dialog style="width:100%;height:100%;background:#000;color:#fff">
<h1 style="color: #aaf;text-align: center">INFO</h1>
<h3 style="text-align: center">Type below, Esc to close</h3>
<div contenteditable="" style="border:5px #aaf solid;padding:10px"></div>
</dialog>
</body>
</html>