-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
278 lines (271 loc) · 7 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<!DOCTYPE html>
<html>
<head>
<title>RPG2 - the Reciprocative Penning Game for 2 players</title>
<link rel="icon" sizes="192x192" href="icon192.png">
<link rel="apple-touch-icon" href="icon192.png">
<meta name="theme-color" content="blue">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, user-scalable=no"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="/socket.io/socket.io.js"></script>
<script src="rpg2.js"></script>
<style>
html, body {
background: black;
color: silver;
font: 110% monospace;
line-height: 200%;
}
a {
color: limegreen;
font-weight: bold;
}
.spinner {
display: inline-block;
animation-duration: 1s;
animation-iteration-count: infinite;
animation-name: spin;
animation-timing-function: linear;
}
@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
h1, h2 {
background: darkblue;
margin: 0.1em 0;
}
h2 {
background: purple;
}
h1:before, h2:before {
content: "[-] "
}
h1.collapse:before, h2.collapse:before {
content: "[+] "
}
h3 {
text-align: center;
}
h3 .byline {
display: block;
font-size: 75%;
}
blockquote {
margin-top: 0;
}
#room label {
display: block;
}
.awesome {
border: thin solid orange;
}
#pages canvas {
margin-top: 0.5em;
width: 20%;
min-width: 128px;
}
#pages div {
clear: both;
padding-top: 1em;
}
#pages div:first-child {
padding-top: inherit;
}
#pages div:nth-child(even) canvas {
float: right;
margin-left: 1em;
}
#pages div:nth-child(odd) canvas {
float: left;
margin-right: 1em;
}
#pages span {
}
input {
vertical-align: middle;
}
input[type=radio] {
vertical-align: inherit;
}
option {
background-repeat: no-repeat;
background-size: 1em 1em;
background-position: 0% 50%;
}
.expand {
margin-bottom: 0.5em;
}
h1.collapse + .expand, h2.collapse + .expand {
display: none;
}
canvas.scene {
width: 50%;
min-width: 256px;
}
canvas {
image-rendering: pixelated;
image-rendering: -moz-crisp-edges;
image-rendering: -o-crisp-edges;
-ms-interpolation-mode: nearest-neighbor;
}
input[type="checkbox"] {
/*transform: scale(1.25, 1.25);*/
}
textarea {
display: block;
height: 6em;
width: 95%;
}
.prog{
color: orange;
}
.ress{
color: grey;
}
label {
white-space: nowrap;
}
label canvas, canvas.char {
transform: scale(3, 3);
padding: 0 8px;
margin: 0 0.25em 0 0.1em;
}
.hidden {
display: none;
}
</style>
</head>
<body>
<img src="gpx.png" class="hidden">
<audio class="hidden" preload="auto">
<source src="smogchime.ogg" type="audio/ogg">
<source src="smogchime.mp3" type="audio/mp3">
</audio>
<div id="room">
Welcome to RPG2: the Reciprocative Penning Game for 2 players!
Meet here with a friend or a friend-to-be, and take turns crafting any
sort of tale you can imagine. There are just a few rules:
<ul>
<li>You wait while your partner adds a page and vice-versa.</li>
<li>If your partner's latest page is <span class="awesome">awesome</span>, mark it so!</li>
<li>After 5 <span class="awesome">awesome</span> pages, either player may finish the story with "THE END"!</li>
</ul>
<ol>
<li>Pick a username:
<input id="localplayer" placeholder="Author">
<button id="signin" disabled>Sign in</button>
<span id="online"></span>
</li>
<li>Pick a partner:<br>
<div class="userlist">
<label>
<input id="localradio" type="radio" name="partner" value="local" checked>
Local player:
<input id="localplayer2" placeholder="Partner">
</label>
<div id="remoteusers"></div>
<span id="status">
<span class="spinner">/</span> Connected and looking for others...
</span>
</div>
</li>
<li><button id="begin">Begin!</button></li>
</ol>
You may see sample stories <a href="stories/">here</a>.
<br>
No information is collected or kept by the server.
RPG2 is Free Software. Grab the code at:<br>
<a href="https://gitlab.com/smogheap/RPG2">https://github.com/smogheap/RPG2</a>
</div>
<div id="story" class="hidden">
<h1>Story</h1>
<div class="expand">
<div id="pages"></div>
</div>
<div id="tools">
<h1>Resolve Previous Page</h1>
<div class="expand">
<label class="awesome">
<input id="awesome" type="checkbox"> Awesome!
</label>
<a href="#" onclick="alert('If the last page is awesome, mark it as such!'); return false;">[?]</a>
<br>
Success odds:
<select id="chanceodds">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
</select>
of 10
<button id="chanceroll">Roll</button>
<a href="#" onclick="alert('Does some event depend on fate? Use this anytime you need a coin flip or a die roll.'); return false;">[?]</a>
<span id="chanceresult"></span>
</div>
</div>
<div id="write">
<h1>Write</h1>
<div class="expand">
Title:
<blockquote>
<input id="title" placeholder="Story Title">
<a href="#" onclick="alert('Pick something very abstract or random if you cannot think of a good title. It may inspire story events, or be artfully detached! You can always change it later, too.'); return false;">[?]</a>
</blockquote>
Scene:
<blockquote>
<canvas class="scene" width=96 height=64></canvas>
<a href="#" onclick="alert('Drag characters and symbols anywhere you like! This display is like the graphpaper map for D&D or the diner table used to plan a heist -- a quick and dirty illustration you can update.'); return false;">[?]</a>
<br>
Backdrop:
<button id="bgroll">Roll</button>
Colors:
<input type="color" id="bgcolor1">
<input type="color" id="bgcolor2">
<button id="colroll">Roll</button>
</blockquote>
Plot:
<blockquote>
<textarea id="plot"></textarea>
</blockquote>
<label>
<input id="endcheck" type="checkbox" disabled>
<span id="theend"><span class="prog">T</span><span class="ress">HE END</span></span>
</label>
<br>
<button id="revert">Revert</button>
<br>
<button id="post">Post</button>
</div>
</div>
</div>
<div id="wait" class="hidden">
<span class="spinner">( )</span>
Waiting for <span id="partner">Your partner</span>...
<br><br>
<label>
<input id="alarm" type="checkbox">
Play a chime when it's my turn
</label>
<button id="chime">Test</button>
</div>
<div id="done" class="hidden">
Thank you for playing!
<br>
<a id="download" href="#" class="hidden">Download this story</a>
<br>
<a id="restart" href="#">Play again</a>
</div>
</body>
</html>