-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
347 lines (301 loc) · 16.9 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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="HaveWords is a P2P AI sharing platform using WebRTC.">
<meta name="authors" content="Github: SamPatt, stevedekorte">
<title>HaveWords - P2P AI Sharing</title>
<link rel="icon" type="image/x-icon" href="./favicon.ico">
<!-- TODO: would be nice to load these ccs loads via JS -->
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="resources/fonts/Barlow Condensed/Barlow Condensed.css">
<link rel="stylesheet" href="resources/fonts/Cardo/Cardo.css">
<link rel="stylesheet" href="resources/fonts/Crimson/Crimson.css">
<link rel="stylesheet" href="resources/fonts/Day Roman/Day Roman.css">
<link rel="stylesheet" href="resources/fonts/Ghibli/Ghibli.css">
<link rel="stylesheet" href="resources/fonts/Harlow/Harlow.css">
<link rel="stylesheet" href="resources/fonts/HarryP/HarryP.css">
<link rel="stylesheet" href="resources/fonts/Lumos/Lumos.css">
<link rel="stylesheet" href="resources/fonts/Moms Typewriter/Moms Typewriter.css">
<link rel="stylesheet" href="resources/fonts/XTypewriter/XTypewriter.css">
<link rel="stylesheet" href="resources/fonts/Sherland Modern/Sherland Modern.css">
<link rel="stylesheet" href="resources/fonts/Handwriting/Handwriting.css">
<link rel="stylesheet" href="resources/fonts/Sand Dunes/Sand Dunes.css">
<script type="importmap">
{
"imports": {
"@3d-dice/dice-box": "./source/external/@3d-dice/dice-box/dist/dice-box.es.min.js",
"@3d-dice/dice-roller-parser": "./source/external/@3d-dice/dice-roller-parser-module-fix.js",
"@3d-dice/dice-parser-interface": "./source/external/@3d-dice//dice-parser-interface/src/ParserInterface.js"
}
}
</script>
<script type="module" src="./source/external/@3d-dice/dice-box/dist/dice-box.es.min.js"></script>
<script src="./source/external/@3d-dice/dice-roller-parser/dist/index.js"></script>
<script type="module" src="./source/external/@3d-dice/dice-roller-parser-module-fix.js"></script>
<script type="module" src="./source/external/@3d-dice//dice-parser-interface/src/ParserInterface.js"></script>
<script src="source/boot/Boot.js"></script>
</head>
<body>
<!-- begin app -->
<div id="loadingView" style="border-radius: 0.25em; display:block; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 0; width: 10em; height: 0.5em; background: inherit; color:white; background-color: #666;">
<div id="innerLoadingView" style="background-color:white; border-radius: 0.25em; height: 0.5em;"></div>
</div>
<div id="appView" style="display:none;">
<div class="main-wrapper">
<!--- ai column --->
<div id="AiChatColumn" class="ColumnView" style="min-width: 40.5em;">
<div class="header" stlye="position: relative;">
<h2>HaveWords.ai <!-- <span style="font-weight: 300; opacity: 0.5; padding-left: 0.1em;">Interactive Generative Fiction</span>--></h2>
<div id="SessionTitle"></div>
<div id="SessionDescription"></div>
<div id="compactButton1" class="compactor">
</div>
<div class="controls" style="display:flex; flex-direction:row;">
<div id="CopyInviteButton" class="subheader smallButton" style="display:none;">copy invite link</div>
<div id="SessionResetButton" class="subheader smallButton">Reset Session</div>
<div id="CopyTranscriptButton" class="subheader smallButton">Copy Transcript</div>
<div id="MusicOnButton" class="subheader smallButton"></div>
<div id="NarrationOnButton" class="subheader smallButton"></div>
<!-- <div id="MicButton" class="subheader smallButton"></div> -->
</div>
</div>
<!--- begin host settings --->
<div class="header optionsContainer scrollingOutput" id="aiSelectionBlock" style="display: none; padding-top: 1em; padding-left:1.5em; flex-grow: 0; border-bottom: 1px solid rgba(255, 255, 255, 0.1);">
<div>
<h2>Welcome to your AI session!</h2>
First, you need to set your OpenAI API key, and select the session options.<br>
If you'd like to invite friends, use the Copy Invite Link button above.<br>
Before you begin, you'll also want to set your player name in the Players column.
<!-- begin Open AI settings -->
<table>
<tr>
<td>
<div>
<div class="inputLabel">OpenAI API Key <a class="infoIcon"
href="https://platform.openai.com/account/api-keys"
target="_blank">ⓘ</a></div>
<input id="apiKeyText" type="password" placeholder="Required" autocomplete="off"
autocorrect="off" autocapitalize="off" spellcheck="false"
class="underlinedInput optionsInput">
</div>
</td>
<td style="padding-left: 1em;">
<div id="AiModelOptionsSection">
<div class="inputLabel">OpenAI Model <span id="AiModelOptionsNote">Loading<span class="dots"><span class="dot dot1">.</span><span class="dot dot2">.</span><span class="dot dot3">.</span>
</span></span></div>
<select id="aiModelOptions">
</select>
</div>
</td>
</tr>
</table>
<table>
<tr>
<td>
<div>
<div class="inputLabel">Image Generator</div>
<select id="imageGenModelOptions" style="padding-left: 1em; padding-right: 1em;">
</select>
</div>
</td>
<td style="padding-left: 1em;">
<div id="midjourneyApiKeyContainer" style="display:none">
<div class="inputLabel">API Key <a class="infoIcon"
href="https://app.midjourneyapi.io/" target="_blank">ⓘ</a></div>
<input id="midjourneyApiKeyText" type="password" placeholder="Enter your Midjourneyapi.io API key"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
class="underlinedInput optionsInput" >
</div>
</td>
<td style="padding-left: 1em; display: none;">
<div id="midjourneyApiBaseUrlContainer" style="display:none">
<div class="inputLabel">Base URL <a class="infoIcon"
href="https://app.midjourneyapi.io/v2" target="_blank">ⓘ</a></div>
<input id="midjourneyApiBaseUrlText" type="text" placeholder="Enter your Midjourneyapi.io API Base URL"
autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
value="https://api.midjourneyapi.io/v2"
class="underlinedInput optionsInput" style="min-width:12em;">
</div>
</td>
</tr>
</table>
<!-- end Open AI settings -->
<!-- begin Azure AI settings -->
<table>
<tr>
<td>
<div>
<div class="inputLabel">Azure API Key <a href="https://portal.azure.com/"
class="infoIcon" target="_blank">ⓘ</a></div>
<input id="azureApiKeyText" type="password"
placeholder="Optional (for narration)" autocomplete="off" autocorrect="off"
autocapitalize="off" spellcheck="false"
class="underlinedInput optionsInput">
</div>
</td>
<td style="padding-left: 1em;">
<div>
<div class="inputLabel">Azure Region</div>
<select id="azureApiRegionOptions">
</select>
</div>
</td>
</tr>
</table>
<!-- end Azure AI settings -->
<!-- begin Session settings -->
<table>
<tr>
<td>
<div>
<div class="inputLabel">Genre</div>
<select id="sessionTypeOptions">
</select>
</div>
</td>
<td>
<div style="padding-left: 1em;">
<div id="sessionSubtypeOptionsLabel" class="inputLabel">As Inspired By</div>
<select id="sessionSubtypeOptions">
</select>
</div>
</td>
<td id="sessionSubtype2OptionsPanel">
<div style="padding-left: 1em;">
<div id="sessionSubtypeOptionsLabel" class="inputLabel"> </div>
<select id="sessionSubtype2Options">
</select>
</div>
</td>
</tr>
<tr>
<td colspan="3" id="sessionDescription"></td>
</tr>
</table>
<div>
<div class="inputLabel">Customization</div>
<input id="sessionCustomizationText" class="underlinedInput"
style="min-width:100%; max-width:100%;"
placeholder="Additional instructions for the AI.">
</div>
<!-- end Session settings -->
<div>
<div class="inputLabel">Language</div>
<select id="sessionLanguageOptions">
</select>
</div>
<div style="display: inline-block; padding-top:1em; padding-bottom: 0.5em;">
<div id="sessionStartButton" class="button"
style="margin-top: 0.3em; background-color: transparent;">Start Session</div>
</div>
</div>
</div>
<!--- end host settings --->
<div id="AiChatColumn_ScrollView">
</div>
<!--- begin host & guest inputs --->
<div id="messageInputSection" class="inputSection">
<textarea id="messageInput" class="input-wrapper" rows="3" placeholder="Message the narrator..."></textarea>
</div>
<!--- end host & guest inputs --->
</div>
<!--- begin chat column --->
<div id="GroupChatColumn" class="ColumnView" style="display:flex;">
<div class="header">
<h2>Group Chat</h2>
<div id="compactButton2" class="compactor">
</div>
</div>
<div id="GroupChatColumn_ScrollView">
</div>
<!--- chat input --->
<div id="inputSection" class="inputSection">
<textarea id="chatInput" class="input-wrapper" rows="3"
placeholder="Message the group..."></textarea>
</div>
</div>
<!--- end chat column --->
<!--- begin users column --->
<div id="PlayersColumn" class="ColumnView" style="display:flex;">
<div class="header">
<h2>Players</h2>
<div class="controls" style="display:flex; flex-direction:row;">
<div id="SyncPlayersButton" class="subheader smallButton">Sync</div>
</div>
</div>
<div id="PlayersColumn_ScrollView"></div>
</div>
<!--- end users column --->
</div>
</div>
<!--- begin dice box --->
<div id="diceBox">
</div>
<!--- begin roll panel --->
<table id="rollPanelView" class="message-wrapper nonAiMessage">
<tr>
<th colspan="2"><h2 id="rollPanel_reasonView">Hello</h2></th>
</tr>
<tr>
<td><label for="rollPanel_characterTextField">character:</label></td>
<td><input id="rollPanel_characterTextField" class="TextFieldView" placeholder="name"/></td>
</tr>
<tr>
<td><label for="rollPanel_countTextField">die count:</label></td>
<td><input id="rollPanel_countTextField" class="TextFieldView" placeholder="number"/></td>
</tr>
<tr>
<td><label for="rollPanel_dieOptionsView">die type:</label></td>
<td>
<select id="rollPanel_dieOptionsView">
<option value="4">d4</option>
<option value="6">d6</option>
<option value="8">d8</option>
<option value="10">d10</option>
<option value="12">d12</option>
<option value="20">d20</option>
<option value="100">d100</option>
</select>
</td>
</tr>
<tr>
<td><label for="rollPanel_modifierTextField">modifier:</label></td>
<td><input id="rollPanel_modifierTextField" class="TextFieldView" placeholder="+/- number"/></td>
</tr>
<tr>
<td><label for="rollPanel_keepDropOptionsView">keep/drop:</label></td>
<td>
<select id="rollPanel_keepDropOptionsView">
<option value="k" selected>Keep</option>
<option value="d">Drop</option>
</select>
</td>
</tr>
<tr>
<td><label for="rollPanel_keepDropHighLowOptionsView">k/d type:</label></td>
<td>
<select id="rollPanel_keepDropHighLowOptionsView">
<option value="h" selected>High</option>
<option value="l">Low</option>
</select>
</td>
</tr>
<tr>
<td><label for="rollPanel_keepDropCountTextField">k/d count:</label></td>
<td><input id="rollPanel_keepDropCountTextField" class="TextFieldView" placeholder="number"/></td>
</tr>
<tr>
<td><label for="rollPanel_targetTextField">target:</label></td>
<td><input id="rollPanel_targetTextField" class="TextFieldView" placeholder="number"/></td>
</tr>
<tr>
<td colspan="2" class="rollPanelButtons">
<button id="rollPanel_rollButton">Roll Dice</button>
<button id="rollPanel_cancelButton">Cancel</button>
</td>
</tr>
</table>
</body>
</html>