Commit
·
d4c15b2
1
Parent(s):
64ada0a
Update index.html
Browse files- index.html +94 -17
index.html
CHANGED
@@ -1,19 +1,96 @@
|
|
1 |
<!DOCTYPE html>
|
2 |
-
<html>
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
</html>
|
|
|
1 |
<!DOCTYPE html>
|
2 |
+
<html lang="en">
|
3 |
+
<head>
|
4 |
+
<meta charset="UTF-8">
|
5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6 |
+
<title>Speech Recognition Landing Page</title>
|
7 |
+
<style>
|
8 |
+
body {
|
9 |
+
font-family: Arial, sans-serif;
|
10 |
+
background-color: #f5f5f5;
|
11 |
+
margin: 0;
|
12 |
+
padding: 0;
|
13 |
+
}
|
14 |
+
|
15 |
+
header {
|
16 |
+
background-color: #333;
|
17 |
+
color: #fff;
|
18 |
+
padding: 20px;
|
19 |
+
text-align: center;
|
20 |
+
}
|
21 |
+
|
22 |
+
h1 {
|
23 |
+
font-size: 36px;
|
24 |
+
}
|
25 |
+
|
26 |
+
.container {
|
27 |
+
max-width: 800px;
|
28 |
+
margin: 0 auto;
|
29 |
+
padding: 20px;
|
30 |
+
}
|
31 |
+
|
32 |
+
#output {
|
33 |
+
background-color: #fff;
|
34 |
+
border: 1px solid #ccc;
|
35 |
+
padding: 10px;
|
36 |
+
margin-top: 20px;
|
37 |
+
min-height: 150px;
|
38 |
+
}
|
39 |
+
|
40 |
+
#output p {
|
41 |
+
margin: 0;
|
42 |
+
}
|
43 |
+
|
44 |
+
#speechButton {
|
45 |
+
background-color: #0073e6;
|
46 |
+
color: #fff;
|
47 |
+
padding: 10px 20px;
|
48 |
+
border: none;
|
49 |
+
cursor: pointer;
|
50 |
+
font-size: 18px;
|
51 |
+
}
|
52 |
+
|
53 |
+
#speechButton:hover {
|
54 |
+
background-color: #005bb7;
|
55 |
+
}
|
56 |
+
</style>
|
57 |
+
</head>
|
58 |
+
<body>
|
59 |
+
<header>
|
60 |
+
<h1>Speech Recognition Landing Page</h1>
|
61 |
+
</header>
|
62 |
+
<div class="container">
|
63 |
+
<h2>Speech to Text</h2>
|
64 |
+
<button id="speechButton">Start Recording</button>
|
65 |
+
<div id="output">
|
66 |
+
<p>Transcription will appear here...</p>
|
67 |
+
</div>
|
68 |
+
</div>
|
69 |
+
|
70 |
+
<script>
|
71 |
+
const speechButton = document.getElementById('speechButton');
|
72 |
+
const output = document.getElementById('output');
|
73 |
+
const recognition = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
74 |
+
|
75 |
+
recognition.lang = 'en-US';
|
76 |
+
|
77 |
+
speechButton.addEventListener('click', () => {
|
78 |
+
recognition.start();
|
79 |
+
speechButton.disabled = true;
|
80 |
+
speechButton.innerText = 'Recording...';
|
81 |
+
});
|
82 |
+
|
83 |
+
recognition.onresult = (event) => {
|
84 |
+
const transcript = event.results[0][0].transcript;
|
85 |
+
const p = document.createElement('p');
|
86 |
+
p.textContent = transcript;
|
87 |
+
output.appendChild(p);
|
88 |
+
};
|
89 |
+
|
90 |
+
recognition.onend = () => {
|
91 |
+
speechButton.disabled = false;
|
92 |
+
speechButton.innerText = 'Start Recording';
|
93 |
+
};
|
94 |
+
</script>
|
95 |
+
</body>
|
96 |
</html>
|