-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
104 lines (98 loc) · 4.71 KB
/
index.html
File metadata and controls
104 lines (98 loc) · 4.71 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
<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="Aplicación PWA para leer textos en voz alta usando Web Speech API">
<meta name="theme-color" content="#2563eb">
<title>Lector de Textos</title>
<link rel="manifest" href="./manifest.json">
<link rel="stylesheet" href="styles.css">
<link rel="icon" type="image/png" href="icon-192.png">
</head>
<body>
<div class="container">
<header>
<h1>Lector de Textos</h1>
<p class="subtitle">Pega tu texto y escúchalo en voz alta</p>
</header>
<main>
<div class="textarea-container">
<textarea
id="textInput"
placeholder="Pega o escribe aquí el texto que quieres escuchar..."
rows="12"
></textarea>
</div>
<div class="controls">
<div class="voice-control">
<label>Voz:</label>
<div class="voice-wrapper">
<button type="button" id="voiceTrigger" class="voice-trigger" aria-haspopup="listbox" aria-expanded="false" aria-label="Elegir voz">
<span id="voiceTriggerLabel">Cargando voces...</span>
<svg class="voice-trigger-icon" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="6 9 12 15 18 9"></polyline></svg>
</button>
<div id="voicePanel" class="voice-panel" role="listbox" hidden>
<div class="voice-section voice-favorites">
<div class="voice-section-title">Favoritas</div>
<div id="voiceListFavorites" class="voice-list"></div>
</div>
<div class="voice-section voice-all">
<div class="voice-section-title">Todas las voces</div>
<div id="voiceListAll" class="voice-list"></div>
</div>
</div>
</div>
</div>
<div class="speed-control">
<label for="speedRange">Velocidad:</label>
<div class="speed-wrapper">
<input
type="range"
id="speedRange"
min="0.5"
max="2"
step="0.1"
value="1"
>
<span id="speedValue">1.0x</span>
</div>
</div>
<div class="buttons">
<button id="playBtn" class="btn btn-primary" aria-label="Reproducir">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<polygon points="5 3 19 12 5 21 5 3"></polygon>
</svg>
<span>Reproducir</span>
</button>
<button id="pauseBtn" class="btn btn-secondary" aria-label="Pausar" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="6" y="4" width="4" height="16"></rect>
<rect x="14" y="4" width="4" height="16"></rect>
</svg>
<span>Pausar</span>
</button>
<button id="stopBtn" class="btn btn-secondary" aria-label="Detener" disabled>
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<rect x="6" y="6" width="12" height="12"></rect>
</svg>
<span>Detener</span>
</button>
</div>
</div>
<div id="status" class="status" aria-live="polite"></div>
</main>
</div>
<script src="app.js"></script>
<script>
// Registrar service worker
if ('serviceWorker' in navigator) {
window.addEventListener('load', () => {
navigator.serviceWorker.register('service-worker.js')
.then(reg => console.log('Service Worker registrado'))
.catch(err => console.log('Error al registrar Service Worker:', err));
});
}
</script>
</body>
</html>