yum-slop/TaSTT
Free self-hosted STT for VRChat.
git clone https://git.yummers.dev/yum-slop/TaSTT
c2bc70c
v0.19.2
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 () { 69$ . ajax ({ 70url : 'http://localhost:%PORT%/api/v0/transcript' , 71method : 'GET' , 72dataType : 'json' , 73success : function ( data ) { 74// dirty hack: create a bunch of invisible content to push the 75// transcript down the bottom 76var transcriptHtml = '<span class="transcript" style="opacity: 0">' 77+ '___ ' . repeat ( 128 ) + '</span>' ; 78data . commits . forEach ( function ( commit , index ) { 79let age = data . ts - commit . ts ; 80let min_age_s = 5.0 ; 81let max_age_s = 60.0 ; 82let opacity = 1.0 - ( age - min_age_s ) / ( max_age_s - min_age_s ) ; 83opacity = Math . max ( 0 , opacity ) ; 84opacity = Math . min ( 1 , opacity ) ; 85transcriptHtml += `<span class="transcript" style="opacity: ${ opacity } ;"> ${ commit . delta } </span>` ; 86}) ; 87 88// Append the preview with full opacity if it exists 89if ( data . preview && data . preview . preview ) { 90transcriptHtml += `<span class="preview" style="opacity: 1;"> ${ data . preview . preview } </span>` ; 91} 92 93// Create the circle indicator 94var circleHtml = data . preview . preview ? 95'<span class="red_circle"></span>' : 96'<span class="grey_circle"></span>' ; 97 98$ ( '#content' ) . html ( transcriptHtml + circleHtml ) ; 99$ ( '#content' ) . css ( "background-color" , "#22222280" ) ; 100} , 101error : function ( jqXHR , textStatus , errorThrown ) { 102console . error ( 'Error getting transcript: ' , textStatus , errorThrown ) ; 103} 104}) ; 105scrollToBottom () ; 106} 107 108setInterval ( getTranscript , /*interval_ms=*/ 100 ) ; 109</ script > 110 111</ body > 112</ html >