blob: 96692cf08c938db39f9491165f617743c068c503 (
plain)
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
|
<!DOCTYPE html>
<html>
<head>
<title>TaSTT</title>
<script src="https://code.jquery.com/jquery-3.6.3.min.js"></script>
<link rel="stylesheet"
href="https://fonts.googleapis.com/css?family=Noto+Sans+Mono&display=swap">
</head>
<style>
body {
font-family: 'Noto Sans Mono', monospace;
font-size: 96px;
font-weight: 3200;
color: #000;
}
#transcript {
color: #89CFF0;
-webkit-text-stroke: 3.0px #000;
}
.red_circle {
height: 50px;
width: 50px;
background-color: red;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin: 20px;
}
.grey_circle {
height: 50px;
width: 50px;
background-color: grey;
border-radius: 50%;
display: inline-block;
vertical-align: middle;
margin: 20px;
}
</style>
<body>
<div id="transcript"></div>
<script>
function scrollToBottom() {
window.scrollTo(0,document.body.scrollHeight);
}
function getTranscript() {
$.ajax({
url: 'http://localhost:%PORT%/api/transcript',
method: 'GET',
dataType: 'json',
success: function(data) {
var transcript = data.transcript;
var red_circle = '<span class="red_circle"></span>';
var grey_circle = '<span class="grey_circle"></span>';
var transcript_w_circle = transcript;
if (data.is_final == 1) {
transcript_w_circle += grey_circle;
} else {
transcript_w_circle += red_circle;
}
$('#transcript').html(transcript_w_circle);
$('#transcript').css("background-color", "#00000080");
},
error: function(jqXHR, textStatus, errorThrown) {
console.error('Error getting transcript: ', textStatus, errorThrown);
}
});
scrollToBottom();
}
setInterval(getTranscript, /*interval_ms=*/100);
</script>
</body>
</html>
|