-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
259 lines (252 loc) · 8.09 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta
name="description"
content="TTS Assistant is a user-friendly web application that converts text to speech using OpenAI's API. Enter your text, select your preferences for voice, speed, and format, and generate high-quality speech audio. Ideal for creating audio files from written content with a simple, intuitive interface. OpenAI API key is required."
/>
<title>TTS Assistant</title>
<noscript>
<!-- If JavaScript is disabled, redirect to no-js.html after 2 seconds -->
<meta http-equiv="refresh" content="2;url=no-js.html" />
</noscript>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="preload"
href="https://fonts.googleapis.com/css2?family=Nunito:wght@900&family=PT+Sans&display=swap"
as="style"
onload="this.onload=null;this.rel='stylesheet'"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="./favicons/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="./favicons/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="./favicons/favicon-16x16.png"
/>
<link rel="manifest" href="./favicons/site.webmanifest" />
<link
rel="mask-icon"
href="./favicons/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#00aba9" />
<meta name="theme-color" content="#ffffff" />
<link
rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/modern-normalize/2.0.0/modern-normalize.min.css"
integrity="sha512-4xo8blKMVCiXpTaLzQSLSw3KFOVPWhm/TRtuPVc4WG6kUgjH6J03IBuG7JZPkcWMxJ5huwaBpOpnwYElP/m6wg=="
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<link rel="stylesheet" href="./styles/vars.css" />
<link rel="stylesheet" href="./styles/global.css" />
<link rel="stylesheet" href="./styles/utils.css" />
<link rel="stylesheet" href="./styles/layout.css" />
<link rel="stylesheet" href="./styles/looks.css" />
</head>
<body id="app">
<div id="global-error" class="hidden banner"></div>
<div id="global-save" class="hidden banner"></div>
<div
id="page-loading"
class="page page-loading text-center block"
data-show="true"
>
<section class="main">
<div class="content-area py-3 px-2">
<div class="loading">
<div class="loading-text">... Loading TTS Assistant ...</div>
<div class="error hidden text-red mt-2">This is an error</div>
</div>
</div>
</section>
</div>
<div id="page-settings" class="page page-settings flex" data-show="false">
<section class="main bg-light-tan-alpha outline rounded">
<menu class="toolbar bg-light-tan">
<li><h1 class="app-name">TTS Assistant 🔊</h1></li>
</menu>
<div class="content-area text-center py-3 px-2">
<div class="settings">
<div class="setting py-1">
<label for="openai-key" class="block mb-2"
>OpenAI Key - Saved locally, only used with the
API: </label
>
<input
type="text"
id="openai-key"
class="input-text"
style="width: 60ch; max-width: 80%"
/>
</div>
</div>
<div class="credits">
<p class="mt-2 mb-1">
This app was created by
<a href="https://twitter.com/DavidBradbury" class="link"
>David Bradbury</a
>
and is not affiliated with OpenAI.
</p>
<p>
The source code is available on
<a
href="https://github.com/DavidBradbury/tts-assistant"
class="link"
>GitHub</a
>.
</p>
</div>
</div>
</section>
<div class="footer bg-light-tan-alpha outline rounded p-2">
<div class="footer-bottom flex justify-between items-center">
<div class="footer-bottom-left"> </div>
<div class="footer-bottom-right">
<button
id="btn-settings-cancel"
type="button"
class="btn-default btn-outline hidden"
onclick="main.showMain()"
>
Cancel
</button>
<button
type="button"
class="btn-default"
onclick="main.saveApiKey();"
>
Save
</button>
</div>
</div>
</div>
</div>
<div
id="page-main"
data-show="false"
class="page page-main mobile-block desktop-grid"
style="
grid-template-columns: 3fr 2fr;
grid-template-rows: auto 1fr auto;
gap: var(--size-6x) var(--size-3x);
"
>
<section class="main bg-light-tan-alpha outline rounded">
<menu class="toolbar bg-light-tan">
<li><h1 class="app-name">TTS Assistant 🔊</h1></li>
</menu>
<div class="content-area py-3 px-2">
<textarea
id="input-text"
class="p-2"
style="min-height: 160px"
placeholder="Paste your text here..."
></textarea>
<div id="audio-player-container" class="text-center"></div>
</div>
</section>
<section class="sidebar bg-light-tan-alpha outline rounded">
<menu class="toolbar bg-light-tan">
<li><span class="h1">Files 📂</span></li>
<li class="ml-auto">
<button
type="button"
class="btn-default btn-toolbar"
onclick="main.createNewFile()"
title="New File"
>
New file
</button>
</li>
</menu>
<ul
class="list-none py-2 px-1 m-0"
style="max-height: 50vh; overflow-y: auto"
></ul>
</section>
<section
class="footer bg-light-tan-alpha outline rounded p-2"
style="grid-column: 1 / 3"
>
<div class="footer-top flex flex-start items-center wrap mb-3">
<select
id="model"
name="model"
aria-label="Model"
class="select mr-2"
></select>
<select
id="voice"
name="voice"
aria-label="Voice"
class="select mr-2"
></select>
<select
id="format"
name="format"
aria-label="Format"
class="select mr-2"
></select>
<select
id="speed"
name="speed"
aria-label="Speed"
class="select mr-2"
></select>
<input
id="filename-input"
type="text"
placeholder="Filename"
class="input-text ml-auto"
style="width: 250px"
/>
</div>
<div class="footer-bottom flex justify-between items-center">
<div class="footer-bottom-left">
<button
type="button"
class="btn-default btn-outline"
onclick="main.showSettings()"
>
Settings
</button>
</div>
<div class="footer-bottom-right">
<button
type="button"
class="btn-default"
onclick="main.saveFile();"
>
Save
</button>
<button
type="button"
class="btn-default"
onclick="main.generateSpeech();"
>
Generate
</button>
</div>
</div>
</section>
</div>
<script type="module" src="scripts/main.js"></script>
</body>
</html>