-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
301 lines (276 loc) · 14.6 KB
/
index.html
File metadata and controls
301 lines (276 loc) · 14.6 KB
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
<title>AudioWrite</title>
<link rel="stylesheet" href="index.css" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap"
rel="stylesheet"
/>
<!-- manifest.json link removed as vite-plugin-pwa will handle this -->
<meta name="theme-color" content="#1E1E1E">
<!-- Standard Favicons -->
<link rel="icon" type="image/png" sizes="32x32" href="icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="icons/favicon-16x16.png">
<link rel="shortcut icon" href="icons/favicon.ico">
<!-- Apple Specific PWA Meta Tags -->
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<meta name="apple-mobile-web-app-title" content="AudioWrite">
<link rel="apple-touch-icon" href="/AudioWrite/icons/apple-touch-icon.png?v=2"> <!-- 180x180 recommended -->
<link rel="apple-touch-icon" sizes="152x152" href="/AudioWrite/icons/apple-touch-icon-152x152.png?v=2">
<link rel="apple-touch-icon" sizes="180x180" href="/AudioWrite/icons/apple-touch-icon-180x180.png?v=2">
<link rel="apple-touch-icon" sizes="167x167" href="/AudioWrite/icons/apple-touch-icon-167x167.png?v=2"> <!-- iPad Pro -->
<link rel="apple-touch-icon" sizes="120x120" href="/AudioWrite/icons/apple-touch-icon-120x120.png?v=2"> <!-- iPhone Retina -->
<script type="importmap">
{
"imports": {
"@google/genai": "https://esm.sh/@google/genai@^0.8.0",
"marked": "https://esm.sh/marked@^4.0.0",
"path": "https://esm.sh/path@^0.12.7",
"vite": "https://esm.sh/vite@^6.3.5",
"vite-plugin-pwa": "https://esm.sh/vite-plugin-pwa@^1.0.0",
"url": "https://aistudiocdn.com/url@^0.11.4"
}
}
</script>
</head>
<body>
<div class="app-container">
<div id="iosInstallBanner" class="ios-install-banner hidden">
<p>To install AudioWrite on your iPhone/iPad: tap the Share button <i class="fas fa-share-square"></i> then 'Add to Home Screen'.</p>
<button id="dismissIosInstallBannerButton" class="dismiss-banner-button" title="Dismiss">×</button>
</div>
<div id="focusPromptOverlay" class="focus-prompt-overlay hidden">
<span class="focus-prompt-text">Let's AudioWrite what's on your mind!</span>
</div>
<div class="main-content">
<div class="note-area">
<div class="note-header">
<div class="title-and-meta">
<div class="editor-title" contenteditable="true" placeholder="Untitled Note">
Untitled Note
</div>
<div id="currentNoteTimestamp" class="current-note-timestamp"></div>
</div>
<div class="header-controls">
<div class="language-selector-container">
<label for="outputLanguageSelect">Output Language:</label>
<select id="outputLanguageSelect"></select>
</div>
<div class="auto-polish-container">
<label for="autoPolishToggle" class="auto-polish-label">Auto-Polish</label>
<label class="switch">
<input type="checkbox" id="autoPolishToggle">
<span class="slider round"></span>
</label>
</div>
<div class="tab-and-copy-actions">
<div class="tab-navigation-container">
<div class="tab-navigation">
<button class="tab-button active" data-tab="note">Polished</button>
<button class="tab-button" data-tab="raw">Raw</button>
<div class="active-tab-indicator"></div>
</div>
</div>
<div class="copy-buttons-container">
<button id="copyPolishedNoteButton" class="action-button-small copy-button" title="Copy Polished Note to Clipboard" aria-label="Copy Polished Note to Clipboard">
<i class="fas fa-copy"></i> Copy Polished
</button>
<button id="copyRawTranscriptionButton" class="action-button-small copy-button" title="Copy Raw Transcription to Clipboard" aria-label="Copy Raw Transcription to Clipboard">
<i class="fas fa-copy"></i> Copy Raw
</button>
</div>
</div>
</div>
<div class="custom-prompt-section">
<div class="custom-prompt-actions">
<button id="toggleCustomPromptButton" class="custom-prompt-toggle" title="Edit Custom Prompt">
<i class="fas fa-wand-magic-sparkles"></i> Edit Custom Prompt
</button>
</div>
<div id="customPromptContainer" class="custom-prompt-container hidden">
<textarea id="customPromptTextarea" placeholder="Enter custom polishing instructions here (e.g., summarize in 3 bullet points, adopt a formal tone...). If empty, default polishing will be used."></textarea>
<button id="applyCustomPromptButton" class="action-button-small apply-prompt-button" title="Polish note with current settings" aria-label="Polish note with current settings">
<i class="fas fa-wand-magic-sparkles"></i> Polish with Prompt
</button>
</div>
</div>
</div>
<div class="note-content-wrapper">
<div
id="polishedNote"
class="note-content active"
contenteditable="true"
placeholder="Your polished notes will appear here..."
></div>
<div
id="rawTranscription"
class="note-content"
contenteditable="true"
placeholder="Raw transcription will appear here..."
></div>
</div>
</div>
<div class="recording-interface">
<div id="liveRecordingTitle" class="live-recording-title" style="display: none">
Recording
</div>
<canvas id="liveWaveformCanvas" style="display: none"></canvas>
<div id="liveRecordingTimerDisplay" class="live-recording-timer" style="display: none">
00:00.00
</div>
<div class="status-indicator">
<span id="recordingStatus" class="status-text" aria-live="polite">Ready to record</span>
</div>
<div class="recording-controls">
<button class="action-button" id="archiveButton" title="Notes Archive">
<i class="fas fa-archive"></i>
</button>
<button class="action-button" id="themeToggleButton" title="Toggle Theme">
<i class="fas fa-sun"></i>
</button>
<button id="recordButton" class="record-button" title="Start/Stop Recording">
<div class="record-button-inner">
<i class="fas fa-microphone"></i>
</div>
<svg class="record-waves" viewBox="0 0 200 200">
<circle class="wave wave1" cx="100" cy="100" r="40" />
<circle class="wave wave2" cx="100" cy="100" r="70" />
<circle class="wave wave3" cx="100" cy="100" r="100" />
</svg>
</button>
<button class="action-button" id="settingsButton" title="API Key Settings">
<i class="fas fa-key"></i>
</button>
<button class="action-button" id="newButton" title="New Note">
<i class="fas fa-file"></i>
</button>
</div>
<div class="app-attribution">Created by Hooman Nick © 2025</div>
</div>
</div>
</div>
<div id="archiveModal" class="modal hidden">
<div class="modal-content">
<div class="modal-header">
<h2>Notes Archive</h2>
<button id="closeArchiveModalButton" class="close-button" title="Close Archive">×</button>
</div>
<div id="archiveListContainer" class="archive-list">
<!-- Archived notes will be listed here -->
</div>
</div>
</div>
<div id="settingsModal" class="modal hidden">
<div class="modal-content">
<div class="modal-header">
<h2>Settings</h2>
<button id="closeSettingsModalButton" class="close-button" title="Close Settings">×</button>
</div>
<div class="settings-modal-body">
<div class="settings-section api-key-section">
<h3><i class="fas fa-key"></i> Gemini API Key</h3>
<label for="apiKeyInput">Enter your Gemini API Key:</label>
<input type="password" id="apiKeyInput" placeholder="Paste your API Key here">
<button id="saveApiKeyButton" class="action-button-primary">Save & Apply Key</button>
<p class="api-key-info">Your API Key is stored in your browser's local storage and is never sent anywhere except to Google for API calls. To clear it, save an empty key.</p>
<p id="apiKeyStatus" class="api-key-status"></p>
<div class="api-key-instructions">
<h4>How to get your API key:</h4>
<ol>
<li>Visit <a href="https://aistudio.google.com/app/apikey" target="_blank" rel="noopener noreferrer">Google AI Studio</a>.</li>
<li>Sign in with your Google account.</li>
<li>Click the button to <strong>"Get API key"</strong> or <strong>"Create API key"</strong>.</li>
<li><strong>If you see a message like "Unable to create API key... Please create a project..."</strong>:
<ul>
<li>Click the <strong>"Google Cloud Console" link</strong> in that message (it may open a new tab).</li>
<li>On the "New Project" page:
<ul>
<li>For <strong>Project name</strong>, enter something like <code>testing AudioWrite</code>.</li>
<li>For <strong>Location</strong>, select <strong>"No organization"</strong> if not already chosen.</li>
<li>Click the blue <strong>"Create"</strong> button.</li>
</ul>
</li>
<li>After project creation, close that Google Cloud Console tab and return to the Google AI Studio tab.</li>
</ul>
</li>
<li>Back in Google AI Studio:
<ul>
<li>Select your newly created project (e.g., <code>testing AudioWrite</code>).</li>
<li>Click <strong>"Create API key in existing project"</strong> (or similar).</li>
</ul>
</li>
<li>Your API key will be displayed. <strong>Copy the generated key</strong>.</li>
<li>Return to this app, paste the key into the field above, and click "Save & Apply Key".</li>
</ol>
</div>
</div>
<div id="installAppSection" class="settings-section install-app-section hidden">
<h3><i class="fas fa-download"></i> Install AudioWrite</h3>
<p>Get quick access to AudioWrite by installing it on your device.</p>
<button id="installAppButton" class="action-button-primary">Install App</button>
</div>
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
const tabNav = document.querySelector(".tab-navigation");
if (tabNav) { // Add null check for safety
const tabButtons = tabNav.querySelectorAll(".tab-button");
const activeTabIndicator = tabNav.querySelector(".active-tab-indicator");
const noteContents = document.querySelectorAll(".note-content");
function setActiveTab(activeButton, skipAnimation = false) {
if (!activeButton || !activeTabIndicator) return;
tabButtons.forEach((btn) => btn.classList.remove("active"));
activeButton.classList.add("active");
const tabName = activeButton.getAttribute("data-tab");
noteContents.forEach((content) => content.classList.remove("active"));
if (tabName === "raw") {
document.getElementById("rawTranscription").classList.add("active");
} else {
document.getElementById("polishedNote").classList.add("active");
}
const originalTransition = activeTabIndicator.style.transition;
if (skipAnimation) {
activeTabIndicator.style.transition = "none";
} else {
activeTabIndicator.style.transition = ""; // Revert to CSS defined transition
}
activeTabIndicator.style.left = `${activeButton.offsetLeft}px`;
activeTabIndicator.style.width = `${activeButton.offsetWidth}px`;
if (skipAnimation) {
activeTabIndicator.offsetHeight; // Trigger reflow
activeTabIndicator.style.transition = originalTransition;
}
}
tabButtons.forEach((button) => {
button.addEventListener("click", (e) => {
setActiveTab(e.currentTarget);
});
});
const initiallyActiveButton = tabNav.querySelector(".tab-button.active");
if (initiallyActiveButton) {
requestAnimationFrame(() => {
setActiveTab(initiallyActiveButton, true);
});
}
window.addEventListener("resize", () => {
requestAnimationFrame(() => {
const currentActiveButton = tabNav.querySelector(".tab-button.active");
if (currentActiveButton) {
setActiveTab(currentActiveButton, true);
}
});
});
}
});
</script>
<script type="module" src="index.tsx"></script>
</body>
</html>