diff --git a/static/koboldai.css b/static/koboldai.css index 05e4c349..366f043c 100644 --- a/static/koboldai.css +++ b/static/koboldai.css @@ -3238,4 +3238,8 @@ select { transform: rotate(45deg); transform-origin: left; filter: brightness(100%); +} + +.tts_playing { + text-decoration: underline dotted; } \ No newline at end of file diff --git a/static/koboldai.js b/static/koboldai.js index 49bf3a00..b4626c0f 100644 --- a/static/koboldai.js +++ b/static/koboldai.js @@ -3197,11 +3197,20 @@ function stop_tts() { document.getElementById("reader").src=""; document.getElementById("reader").src="/audio"; document.getElementById("play_tts").textContent = "play_arrow"; + for (item of document.getElementsByClassName("tts_playing")) { + item.classList.remove("tts_playing"); + } } function finished_tts() { next_action = parseInt(document.getElementById("reader").getAttribute("action_id"))+1; action_count = parseInt(document.getElementById("action_count").textContent); + if (next_action-1 == "-1") { + action = document.getElementById("story_prompt"); + } else { + action = document.getElementById("Selected Text Chunk "+(next_action-1)); + } + action.classList.remove("tts_playing"); if (next_action <= action_count) { document.getElementById("reader").src = "/audio?id="+next_action; document.getElementById("reader").setAttribute("action_id", next_action); @@ -3212,6 +3221,16 @@ function finished_tts() { } } +function tts_playing() { + action_id = document.getElementById("reader").getAttribute("action_id"); + if (action_id == "-1") { + action = document.getElementById("story_prompt"); + } else { + action = document.getElementById("Selected Text Chunk "+action_id); + } + action.classList.add("tts_playing"); +} + function view_selection_probabilities() { // Not quite sure how this should work yet. Probabilities are obviously on // the token level, which we have no UI representation of. There are other diff --git a/templates/settings flyout.html b/templates/settings flyout.html index 69234c06..a0a2bc26 100644 --- a/templates/settings flyout.html +++ b/templates/settings flyout.html @@ -84,7 +84,7 @@