yum-slop/TaSTT
Free self-hosted STT for VRChat.
git clone https://git.yummers.dev/yum-slop/TaSTT
6dc21f8
v0.20.0
1<!DOCTYPE html> 2< html > 3< head > 4< title > TaSTT</ title > 5< script src = "https://code.jquery.com/jquery-3.6.3.min.js" ></ script > 6< link rel = "stylesheet" 7href = "https://fonts.googleapis.com/css?family=Noto+Sans+Mono&display=swap" > 8</ head > 9< style > 10body { 11font-family : 'Noto Sans Mono' , monospace; 12font-size : 96 px ; 13font-weight : 3200 ; 14/* xdd */ 15/* https://stackoverflow.com/a/55097644 */ 16text-shadow : 0.0 px 10.0 px 0.02 px #000 , 9.8 px 2.1 px 0.02 px #000 , 4.2 px 17-9.1 px 0.02 px #000 , -8.0 px -6.0 px 0.02 px #000 , -7.6 px 6.5 px 0.02 px 18#000 , 4.8 px 8.8 px 0.02 px #000 , 9.6 px -2.8 px 0.02 px #000 , -0.7 px -10.0 px 190.02 px #000 , -9.9 px -1.5 px 0.02 px #000 , -3.5 px 9.4 px 0.02 px #000 , 8.4 px 205.4 px 0.02 px #000 , 7.1 px -7.0 px 0.02 px #000 , -5.4 px -8.4 px 0.02 px #000 , 21-9.4 px 3.5 px 0.02 px #000 , 1.4 px 9.9 px 0.02 px #000 , 10.0 px 0.8 px 0.02 px 22#000 , 2.9 px -9.6 px 0.02 px #000 , -8.7 px -4.8 px 0.02 px #000 , -6.6 px 7.5 px 230.02 px #000 , 5.9 px 8.0 px 0.02 px #000 , 9.1 px -4.1 px 0.02 px #000 , -2.1 px 24-9.8 px 0.02 px #000 , -10.0 px -0.1 px 0.02 px #000 , -2.2 px 9.8 px 0.02 px #000 , 259.1 px 4.2 px 0.02 px #000 , 6.1 px -8.0 px 0.02 px #000 , -6.5 px -7.6 px 0.02 px 26#000 , -8.8 px 4.7 px 0.02 px #000 , 2.7 px 9.6 px 0.02 px #000 , 10.0 px -0.6 px 270.02 px #000 , 1.5 px -9.9 px 0.02 px #000 , -9.3 px -3.6 px 0.02 px #000 , -5.5 px 288.4 px 0.02 px #000 , 7.0 px 7.2 px 0.02 px #000 , 8.5 px -5.3 px 0.02 px #000 , 29-3.4 px -9.4 px 0.02 px #000 , -9.9 px 1.3 px 0.02 px #000 , -0.8 px 10.0 px 0.02 px 30#000 , 9.6 px 2.9 px 0.02 px #000 , 4.9 px -8.7 px 0.02 px #000 , -7.5 px -6.7 px 310.02 px #000 , -8.1 px 5.9 px 0.02 px #000 , 4.0 px 9.2 px 0.02 px #000 , 9.8 px 32-2.0 px 0.02 px #000 , 0.2 px -10.0 px 0.02 px #000 , -9.7 px -2.3 px 0.02 px #000 , 33-4.3 px 9.0 px 0.02 px #000 , 7.9 px 6.1 px 0.02 px #000 ; 34} 35. transcript { 36color : white ; 37} 38. preview { 39color : white ; 40opacity : 0.65 ; 41} 42. red_circle { 43height : 50 px ; 44width : 50 px ; 45background-color : red ; 46border-radius : 50 % ; 47display : inline-block; 48vertical-align : middle; 49margin : 20 px ; 50} 51. grey_circle { 52height : 50 px ; 53width : 50 px ; 54background-color : grey ; 55border-radius : 50 % ; 56display : inline-block; 57vertical-align : middle; 58margin : 20 px ; 59} 60</ style > 61< body > 62< div id = "content" ></ div > 63< script > 64function scrollToBottom () { 65window . scrollTo ( 0 , document . body . scrollHeight ) ; 66} 67 68function getTranscript () { 69const host = window . location . hostname ; 70const port = window . location . port ; 71$ . ajax ({ 72url : `http:// ${ host } : ${ port } /api/v0/transcript` , 73method : 'GET' , 74dataType : 'json' , 75success : function ( data ) { 76// dirty hack: create a bunch of invisible content to push the 77// transcript down the bottom 78var transcriptHtml = '<span class="transcript" style="opacity: 0">' 79+ '___ ' . repeat ( 128 ) + '</span>' ; 80data . commits . forEach ( function ( commit , index ) { 81let age = data . ts - commit . ts ; 82let min_age_s = 5.0 ; 83let max_age_s = 60.0 ; 84let opacity = 1.0 - ( age - min_age_s ) / ( max_age_s - min_age_s ) ; 85opacity = Math . max ( 0 , opacity ) ; 86opacity = Math . min ( 1 , opacity ) ; 87transcriptHtml += `<span class="transcript" style="opacity: ${ opacity } ;"> ${ commit . delta . trim () + ' ' } </span>` ; 88}) ; 89 90// Append the preview with full opacity if it exists 91if ( data . preview && data . preview . preview ) { 92transcriptHtml += `<span class="preview" style="opacity: 1;"> ${ data . preview . preview } </span>` ; 93} 94 95// Create the circle indicator 96var circleHtml = data . preview . preview ? 97'<span class="red_circle"></span>' : 98'<span class="grey_circle"></span>' ; 99 100$ ( '#content' ) . html ( transcriptHtml + circleHtml ) ; 101$ ( '#content' ) . css ( "background-color" , "#22222280" ) ; 102} , 103error : function ( jqXHR , textStatus , errorThrown ) { 104console . error ( 'Error getting transcript: ' , textStatus , errorThrown ) ; 105} 106}) ; 107scrollToBottom () ; 108} 109 110setInterval ( getTranscript , /*interval_ms=*/ 100 ) ; 111</ script > 112 113</ body > 114</ html >