File size: 9,622 Bytes
8ab789a
 
 
 
 
d5e2966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8ab789a
d5e2966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8ab789a
d5e2966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8ab789a
d5e2966
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8ab789a
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>ATOM - Armenian Transcription</title>
    <style>
        * {
            box-sizing: border-box;
            padding: 0;
            margin: 0;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
        }

        body {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 2rem;
        }

        h1 {
            color: white;
            margin-bottom: 0.5rem;
            font-size: 2.5rem;
            text-align: center;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
        }

        .subtitle {
            color: rgba(255, 255, 255, 0.9);
            margin-bottom: 2rem;
            text-align: center;
            font-size: 1.1rem;
        }

        .container {
            background: white;
            border-radius: 20px;
            padding: 2rem;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            max-width: 900px;
            width: 100%;
        }

        #status {
            padding: 1rem;
            background: #f0f4f8;
            border-radius: 10px;
            margin-bottom: 1.5rem;
            text-align: center;
            font-weight: 500;
            color: #4a5568;
            transition: all 0.3s ease;
        }

        #status.loading { background: #fef3c7; color: #92400e; }
        #status.ready { background: #d1fae5; color: #065f46; }
        #status.recording { background: #fecaca; color: #991b1b; animation: pulse 2s infinite; }
        #status.processing { background: #dbeafe; color: #1e40af; }
        #status.error { background: #fee2e2; color: #991b1b; }

        @keyframes pulse {
            0%, 100% { opacity: 1; }
            50% { opacity: 0.7; }
        }

        .info-box {
            background: #eff6ff;
            border-left: 4px solid #3b82f6;
            padding: 1rem;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            font-size: 0.9rem;
            color: #1e40af;
        }

        .stats {
            display: flex;
            gap: 1rem;
            justify-content: space-around;
            padding: 1rem;
            background: #f9fafb;
            border-radius: 8px;
            margin-bottom: 1.5rem;
        }

        .stat-item { text-align: center; }
        .stat-value { font-size: 1.5rem; font-weight: 700; color: #667eea; }
        .stat-label { font-size: 0.85rem; color: #6b7280; margin-top: 0.25rem; }

        .audio-visualizer {
            height: 80px;
            background: #1f2937;
            border-radius: 8px;
            margin-bottom: 1.5rem;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 1rem;
        }

        .bar {
            width: 6px;
            background: linear-gradient(to top, #10b981, #34d399);
            border-radius: 3px;
            transition: height 0.1s ease;
            min-height: 4px;
        }

        .settings {
            display: flex;
            gap: 1.5rem;
            margin-bottom: 1.5rem;
            flex-wrap: wrap;
            padding: 1rem;
            background: #f9fafb;
            border-radius: 8px;
        }

        .setting-group {
            display: flex;
            flex-direction: column;
            gap: 0.5rem;
        }

        .setting-group label {
            font-size: 0.9rem;
            font-weight: 500;
            color: #4b5563;
        }

        select {
            padding: 0.5rem;
            border: 2px solid #e5e7eb;
            border-radius: 6px;
            font-size: 0.9rem;
            background: white;
        }

        .controls {
            display: flex;
            gap: 1rem;
            justify-content: center;
            margin-bottom: 2rem;
            flex-wrap: wrap;
        }

        button {
            padding: 1rem 2rem;
            font-size: 1rem;
            font-weight: 600;
            border: none;
            border-radius: 10px;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
        }

        button:disabled { opacity: 0.5; cursor: not-allowed; }

        #startBtn { background: #10b981; color: white; }
        #startBtn:hover:not(:disabled) {
            background: #059669;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }

        #stopBtn { background: #ef4444; color: white; }
        #stopBtn:hover:not(:disabled) {
            background: #dc2626;
            transform: translateY(-2px);
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }

        #clearBtn { background: #6b7280; color: white; }
        #clearBtn:hover:not(:disabled) { background: #4b5563; }

        .transcription-container {
            background: #f9fafb;
            border: 2px solid #e5e7eb;
            border-radius: 10px;
            padding: 1.5rem;
            min-height: 300px;
            max-height: 500px;
            overflow-y: auto;
        }

        .transcription-item {
            margin-bottom: 1rem;
            padding: 1rem;
            background: white;
            border-radius: 8px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            animation: slideIn 0.3s ease;
        }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }

        .timestamp {
            font-size: 0.85rem;
            color: #6b7280;
            margin-bottom: 0.5rem;
            font-family: monospace;
        }

        .text {
            color: #1f2937;
            line-height: 1.6;
            font-size: 1.1rem;
        }

        .empty-state {
            text-align: center;
            color: #9ca3af;
            padding: 3rem;
        }

        .empty-state svg {
            width: 64px;
            height: 64px;
            margin-bottom: 1rem;
            opacity: 0.5;
        }
    </style>
</head>
<body>
    <h1>๐ŸŽค ATOM - Armenian Transcription</h1>
    <p class="subtitle">Real-time Armenian speech recognition with WebGPU</p>

    <div class="container">
        <div id="status" class="loading">Loading ATOM model...</div>

        <div class="info-box">
            <strong>Armenian-only model:</strong> This custom ATOM model is trained specifically for Armenian speech recognition.
            WebGPU acceleration recommended (Chrome/Edge 113+).
        </div>

        <div class="stats">
            <div class="stat-item">
                <div class="stat-value" id="chunkCount">0</div>
                <div class="stat-label">Chunks Processed</div>
            </div>
            <div class="stat-item">
                <div class="stat-value" id="recordingTime">00:00</div>
                <div class="stat-label">Recording Time</div>
            </div>
        </div>

        <div class="settings">
            <div class="setting-group">
                <label for="chunkLength">Chunk Duration:</label>
                <select id="chunkLength">
                    <option value="3">3 seconds</option>
                    <option value="5" selected>5 seconds</option>
                    <option value="8">8 seconds</option>
                    <option value="10">10 seconds</option>
                </select>
            </div>
            <div class="setting-group">
                <label>
                    <input type="checkbox" id="useWebGPU" checked>
                    Use WebGPU Acceleration
                </label>
            </div>
        </div>

        <div class="audio-visualizer" id="visualizer">
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
            <div class="bar"></div>
        </div>

        <div class="controls">
            <button id="startBtn">๐ŸŽ™๏ธ Start Recording</button>
            <button id="stopBtn" disabled>โน๏ธ Stop Recording</button>
            <button id="clearBtn">๐Ÿ—‘๏ธ Clear</button>
        </div>

        <div class="transcription-container" id="transcriptionContainer">
            <div class="empty-state">
                <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
                    <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 11a7 7 0 01-7 7m0 0a7 7 0 01-7-7m7 7v4m0 0H8m4 0h4m-4-8a3 3 0 01-3-3V5a3 3 0 116 0v6a3 3 0 01-3 3z" />
                </svg>
                <p>Click "Start Recording" to begin transcribing Armenian speech</p>
            </div>
        </div>
    </div>

    <script type="module" src="index.js"></script>
</body>
</html>