feat: enhance HttpTTS link generation with dynamic text input and improve UI styling

This commit is contained in:
王锦强
2025-03-13 22:01:51 +08:00
parent 68b284b2c1
commit 57057688f5
4 changed files with 926 additions and 46 deletions

View File

@@ -207,16 +207,20 @@ document.addEventListener('DOMContentLoaded', function() {
// 复制HttpTTS链接按钮点击事件
copyHttpTtsLinkButton.addEventListener('click', function() {
const text = textInput.value.trim();
if (!text) {
showCustomAlert('请输入要转换的文本', 'warning');
return;
}
const voice = voiceSelect.value;
const style = styleSelect.value;
const rate = rateInput.value;
const pitch = pitchInput.value;
const apiKey = apiKeyInput.value.trim();
const text = "{{java.encodeURI(speakText)}}";
const rate = "{{speakSpeed*4}}";
// 构建HttpTTS链接
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${text}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
let httpTtsLink = `${window.location.origin}${config.basePath}/tts?t=${encodeURIComponent(text)}&v=${voice}&r=${rate}&p=${pitch}&s=${style}`;
// 添加API Key参数如果有
if (apiKey) {

876
web/static/js/tailwind.js Normal file

File diff suppressed because one or more lines are too long