-
Notifications
You must be signed in to change notification settings - Fork 0
/
alpha.html
271 lines (259 loc) · 12.3 KB
/
alpha.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
<!DOCTYPE html>
<html>
<head>
<title>Chat Application</title>
<link rel="stylesheet" href="/grimoire/styles.css">
</head>
<body>
<div class="container">
<div class="left-column">
<div class="sidebar-header">
<button id="toggleSidebar" class="btn">Collapse</button>
<button id="newsBtn" class="btn">News</button> <!-- Added News button -->
</div>
<div class="sidebar-content">
<button id="landingBtn" class="btn">Landing Page</button>
<button id="threadsBtn" class="btn">Chat Threads</button>
<button id="settingsBtn" class="btn">User Settings</button>
<div id="threadList"></div>
</div>
<div class="sidebar-footer">
<a href="https://ttalesinteractive.com/?page_id=1984" target="_blank" class="about-btn">About</a>
<button id="appearanceBtn" class="btn">Appearance</button>
<button id="purgeDataBtn" class="btn">Purge All Data</button>
</div>
</div>
<button id="expandSidebar" class="btn">Expand</button>
<div class="middle-column">
<!-- Landing Page -->
<div id="landingPage" class="landing-page">
<h2 class="section-header">Your Characters</h2>
<div id="characterCardsContainer">
<!-- Character cards will be dynamically added here -->
</div>
<h2 class="section-header">Example Characters</h2>
<div id="exampleCharactersContainer">
<!-- Example character cards will be dynamically added here -->
</div>
</div>
<!-- Current Chat -->
<div id="currentChat" class="current-chat">
<div id="chatMessages">
<div class="user-message">
<img class="message-avatar" src="default-avatar.png" alt="user avatar">
<div class="message-content">User message example</div>
</div>
<div class="ai-message">
<img class="message-avatar" src="default-character-avatar.png" alt="character avatar">
<div class="message-content">AI message example</div>
</div>
</div>
<div class="message-input">
<select id="modelSelect">
<option value="claude">Claude</option>
<option value="gpt">GPT</option>
<option value="cohere">Cohere</option>
</select>
<button id="modelSettingsBtn" class="btn">Model Settings</button>
<textarea id="messageInput" rows="1" placeholder="Type your message..."></textarea>
<button id="sendBtn" class="btn">Send</button>
</div>
</div>
</div>
</div>
<!-- Appearance Modal -->
<div id="appearanceModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeModal()">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<h2>Appearance Settings</h2>
<form id="appearanceForm">
<label for="cssClassSelect">Select CSS Class:</label>
<select id="cssClassSelect"></select>
<div id="cssProperties"></div>
<button type="button" id="saveCssButton" class="btn">Save</button>
</form>
<button id="exportCssButton" class="btn">Export CSS Profile</button>
<input type="file" id="importCssInput" class="btn" style="display: none;">
<label for="importCssInput" class="btn">Import CSS Profile</label>
<button id="clearCssButton" class="btn">Clear Settings</button> <!-- Added Clear Settings button -->
</div>
</div>
<!-- News Modal -->
<div id="newsModal" class="modal">
<div class="modal-content">
<span class="close" onclick="closeNewsModal()">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<h2>Latest News</h2>
<h2>Current Patch: 1.3</h2>
<div id="newsContent">
<p id="stickyMessage">Hotfix: Cohere is working again. The auto scrolling bug has been fixed.</p>
<p id="welcomeMessage">Welcome to Grimoire! Here you can find the latest news and updates. Thanks for joining us, this'll look better and better as time goes on! - Eli</p>
<select id="newsSelect" onchange="loadNewsContent()">
<option value="current">1.3</option>
<option value="upcoming">Upcoming Changes</option>
<option value="prioronedottwo">1.2</option>
<option value="prioronedotone">1.1</option>
<option value="initialonedot">1.0</option>
</select>
<div id="newsDetails">
<!-- News details will be dynamically added here -->
</div>
</div>
</div>
</div>
<!-- Settings Modal -->
<div id="settingsModal" class="modal">
<div class="modal-content">
<span class="close">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<h2>User Settings</h2>
<div id="userSettingsContent">
<h3>User Profile</h3>
<img id="userAvatar" src="default-avatar.png" alt="user avatar" style="width: 100px; height: 100px;">
<form id="avatarForm">
<label for="avatarInput">Select Avatar:</label>
<input type="file" id="avatarInput" accept="image/*">
</form>
</div>
<hr>
<h2>API Keys</h2>
<form id="apiKeyForm">
<label for="userName">User Name:</label>
<input type="text" id="userName" name="userName">
<label for="claudeKey">Claude API Key:</label>
<input type="text" id="claudeKey">
<label for="gptKey">GPT API Key:</label>
<input type="text" id="gptKey">
<label for="cohereKey">Cohere API Key:</label>
<input type="text" id="cohereKey">
<button type="submit" class="btn">Save</button>
</form>
</div>
</div>
<!-- Character Card Modal -->
<div id="characterModal" class="modal">
<div class="modal-content">
<h2>Create Character</h2>
<span class="close">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<form id="characterForm">
<label for="characterName">Character Name:</label>
<input type="text" id="characterName" required>
<label for="characterAvatar">Character Avatar:</label>
<input type="file" id="characterAvatar" accept="image/*">
<img id="characterAvatarPreview" src="default-character-avatar.png" alt="character avatar" style="width: 100px; height: 100px;">
<label for="characterInstruction">Instruction Message:</label>
<textarea id="characterInstruction" rows="4"></textarea>
<label for="characterReminder">Reminder Message:</label>
<textarea id="characterReminder" rows="4"></textarea>
<label for="characterInitialMessage">Initial Message:</label>
<textarea id="characterInitialMessage" rows="4"></textarea>
<button type="submit" class="btn">Create</button>
</form>
</div>
</div>
<!-- Edit Character Card Modal -->
<div id="editCharacterModal" class="modal">
<div class="modal-content">
<h2>Edit Character</h2>
<span class="close">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<form id="editCharacterForm">
<input type="hidden" id="editCharacterId">
<label for="editCharacterName">Character Name:</label>
<input type="text" id="editCharacterName" required>
<label for="editCharacterAvatar">Character Avatar:</label>
<input type="file" id="editCharacterAvatar" accept="image/*">
<img id="editCharacterAvatarPreview" src="" alt="character avatar" style="width: 100px; height: 100px;">
<label for="editCharacterInstruction">Instruction Message:</label>
<textarea id="editCharacterInstruction" rows="4"></textarea>
<label for="editCharacterReminder">Reminder Message:</label>
<textarea id="editCharacterReminder" rows="4"></textarea>
<label for="editCharacterInitialMessage">Initial Message:</label>
<textarea id="editCharacterInitialMessage" rows="4"></textarea>
<button type="submit" class="btn">Save</button>
</form>
</div>
</div>
<div id="errorModal" class="modal">
<div class="modal-content">
<span class="close" onclick="hideErrorModal()">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<p id="errorMessage"></p>
<div id="errorLogs" class="error-logs"></div>
<button id="copyErrorBtn" onclick="copyErrorLogs()">Copy Error</button>
</div>
</div>
<!-- Model Settings Modal -->
<div id="modelSettingsModal" class="modal">
<div class="modal-content">
<span class="close">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<h2>Model Settings</h2>
<select id="presetSelect">
<option value="">Select a preset</option>
<!-- Preset options will be dynamically added here -->
</select>
<button id="savePresetBtn" class="btn">Save as Preset</button>
<form id="modelSettingsForm">
<!-- Input fields will be dynamically added here -->
<button type="submit" class="btn">Save</button>
</form>
</div>
</div>
<!-- Edit Message Modal -->
<div id="editMessageModal" class="modal">
<div class="modal-content">
<span class="close">
<svg xmlns="https://ttalesinteractive.com/grimoire/close.svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<line x1="18" y1="6" x2="6" y2="18"></line>
<line x1="6" y1="6" x2="18" y2="18"></line>
</svg>
</span>
<h2>Edit Message</h2>
<form id="editMessageForm">
<input type="hidden" id="editMessageId">
<label for="editMessageContent">Message Content:</label>
<textarea id="editMessageContent" required></textarea>
<button type="submit" class="btn">Save</button>
</form>
</div>
</div>
<script src="https://unpkg.com/dexie/dist/dexie.js"></script>
<script src="https://cdn.jsdelivr.net/npm/smooth-scroll@16.1.3/dist/smooth-scroll.polyfills.min.js"></script>
<script type="module" src="/grimoire/app.js"></script>
<script type="module" src="/grimoire/models.js"></script>
<script type="module" src="/grimoire/modelSettings.js"></script>
<script type="module" src="/grimoire/news12.js"></script> <!-- Added news.js script -->
<script type="module" src="/grimoire/appearance.js"></script>
</body>
</html>