-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopup.html
223 lines (220 loc) · 7.9 KB
/
popup.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
<!DOCTYPE html>
<html>
<head>
<title>FableVoice Settings</title>
<style>
body {
width: 300px;
padding: 20px;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #1a1c1e;
color: #e0e0e0;
margin: 0;
box-sizing: border-box;
}
* {
box-sizing: inherit;
}
h2 {
color: #ffd700;
margin-top: 0;
margin-bottom: 20px;
text-align: center;
font-size: 24px;
}
h3 {
color: #ffd700;
margin-top: 20px;
margin-bottom: 10px;
font-size: 18px;
}
.setting {
margin-bottom: 15px;
}
label {
display: inline-block;
margin-bottom: 5px;
font-weight: bold;
color: #ffd700;
}
input[type="password"], select, button, textarea {
width: 100%;
padding: 8px;
border: 1px solid #444;
background-color: #2a2c2e;
color: #e0e0e0;
border-radius: 4px;
box-sizing: border-box;
}
select {
margin-bottom: 0;
}
button {
padding: 10px;
background-color: #ffd700;
color: #1a1c1e;
border: none;
cursor: pointer;
font-weight: bold;
transition: background-color 0.3s;
margin-top: 10px;
}
button:hover {
background-color: #ffea00;
}
#status {
font-weight: bold;
color: #ffd700;
}
#voiceList {
max-height: 150px;
overflow-y: auto;
}
.status-container {
text-align: center;
margin-bottom: 20px;
}
.checkbox-setting {
display: flex;
align-items: center;
margin-bottom: 10px;
}
.checkbox-setting input[type="checkbox"] {
margin-right: 10px;
}
.checkbox-setting label {
margin-bottom: 0;
}
.api-description {
font-size: 0.9em;
color: #b0b0b0;
margin-top: 5px;
line-height: 1.4;
}
.api-link {
color: #ffd700;
text-decoration: none;
transition: color 0.3s;
}
.api-link:hover {
color: #ffea00;
text-decoration: underline;
}
</style>
</head>
<body>
<h2>FableVoice Settings</h2>
<div class="status-container">
<p>Addon is <span id="status">disabled</span></p>
<button id="toggleTTS">Enable Addon</button>
</div>
<div class="setting">
<label for="apiKey">Cartesia API Key:</label>
<input type="password" id="apiKey" placeholder="Enter your Cartesia API key">
<p class="api-description">Enhance your Fables experience with text-to-speech. Get your free Cartesia API key <a href="https://cartesia.ai/" target="_blank" class="api-link">here</a>.</p>
</div>
<div class="setting">
<label for="openaiApiKey">OpenAI API Key:</label>
<input type="password" id="openaiApiKey" placeholder="Enter your OpenAI API key">
<p class="api-description">Power intelligent music selection for your scenes and AI-assisted editing. Get your OpenAI API key <a href="https://platform.openai.com/api-keys" target="_blank" class="api-link">here</a>.</p>
</div>
<h3>Text-To-Speech</h3>
<div class="setting">
<label for="voiceSelect">Voice:</label>
<select id="voiceSelect">
<option value="">Loading voices...</option>
</select>
</div>
<div class="setting">
<label for="speedSelect">Speed:</label>
<select id="speedSelect">
<option value="slowest">Slowest</option>
<option value="slow">Slow</option>
<option value="normal" selected>Normal</option>
<option value="fast">Fast</option>
<option value="fastest">Fastest</option>
</select>
</div>
<div class="checkbox-setting">
<input type="checkbox" id="autoPlayNew" checked>
<label for="autoPlayNew">Auto Play Franz</label>
</div>
<div class="checkbox-setting">
<input type="checkbox" id="autoPlayOwn">
<label for="autoPlayOwn">Auto Play Players</label>
</div>
<div class="checkbox-setting">
<input type="checkbox" id="useNpcVoices">
<label for="useNpcVoices">Use NPC Voices</label>
</div>
<span class="api-description">(requires OpenAI key to process dialog into separate voices)</span>
<h3>Speech-To-Text</h3>
<div class="checkbox-setting">
<input type="checkbox" id="autoSendAfterSpeaking">
<label for="autoSendAfterSpeaking">Auto Send After Speaking</label>
</div>
<div class="checkbox-setting">
<input type="checkbox" id="aiEnhancedTranscriptions">
<label for="aiEnhancedTranscriptions">AI Enhanced Transcriptions</label>
</div>
<span class="api-description">(requires OpenAI key to process transcriptions)</span>
<h3>UI</h3>
<div class="setting">
<label for="locationBackground">Use Location as Background:</label>
<select id="locationBackground">
<option value="off">Off</option>
<option value="normal">Normal</option>
<option value="dark">Dark</option>
</select>
</div>
<div class="checkbox-setting">
<input type="checkbox" id="improvedLocationDetection">
<label for="improvedLocationDetection">Improved Location Detection</label>
</div>
<h3>Music</h3>
<div class="checkbox-setting">
<input type="checkbox" id="autoSelectMusic">
<label for="autoSelectMusic">Auto-Select Based on Scene</label>
</div>
<div class="setting">
<label for="musicAiNotes">Notes to Music AI:</label>
<textarea id="musicAiNotes" rows="3" style="width: 100%;" placeholder="Enter any additional notes for music selection..."></textarea>
</div>
<p class="api-description">Music provided by <a href="https://tabletopaudio.com/" target="_blank" class="api-link">Tabletop Audio</a>.</p>
<span class="api-description">(requires OpenAI key to suggest background music)</span>
<h3>Editor</h3>
<div class="checkbox-setting">
<input type="checkbox" id="enableStoryEditor">
<label for="enableStoryEditor">Enable Story Editor</label>
</div>
<div class="setting">
<label for="maxRevisions">Max Revisions in a Row:</label>
<input type="number" id="maxRevisions" min="1" max="10" value="3">
</div>
<div class="setting">
<label for="disallowedElements">Disallowed Story Elements:</label>
<textarea id="disallowedElements" rows="3" style="width: 100%;" placeholder="- windmills
- hooded figures
- ornate boxes
- any use of the word 'conspiritorial'"></textarea>
</div>
<div class="setting">
<label for="disallowedRelaxed">Disallowed While Relaxed:</label>
<textarea id="disallowedRelaxed" rows="3" style="width: 100%;" placeholder="- quests
- magic
- bandits
- combat
- urgency"></textarea>
<span class="api-description">(requires OpenAI key to scan and edit story)</span>
</div>
<h3>Instructions</h3>
<div class="setting">
<label for="instructionsText">Add Custom Instructions:</label>
<textarea id="instructionsText" rows="3" style="width: 100%;" placeholder="- Franz allows each NPC in the scene a chance to speak or be mentioned"></textarea>
</div>
<p class="api-description">EXPERIMENTAL - only use high priority instructions that Franz needs to follow at all times</p>
<button id="loadVoices" style="margin-top: 0px;">Load Voices</button>
<button id="saveSettings">Save Settings</button>
<script src="popup.js"></script>
</body>
</html>