feat: 添加快捷提示词标签,点击即可追加到描述

This commit is contained in:
zwbcc
2026-03-28 21:09:56 +08:00
parent 7cddeaa0d3
commit f8c087fb3f
3 changed files with 77 additions and 0 deletions

16
ui.js
View File

@@ -221,6 +221,22 @@ generateForm.addEventListener('submit', async (e) => {
}
});
// ── Quick prompt tags ──────────────────────────────────────────
document.querySelectorAll('.tag-pill').forEach(btn => {
btn.addEventListener('click', () => {
const tag = btn.dataset.tag;
const current = promptInput.value.trim();
if (current) {
promptInput.value = current + '' + tag;
} else {
promptInput.value = tag;
}
promptInput.dispatchEvent(new Event('input'));
promptInput.focus();
});
});
// ── Prompt char count ──────────────────────────────────────────
promptInput.addEventListener('input', () => {