LittleMouse
Update Web
221f6d7
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>M5Stack LLM8850 画像生成展示</title>
<style>
:root {
--primary-color: #3498db;
--selected-color: #e74c3c;
--success-color: #27ae60;
--warning-color: #f39c12;
}
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
margin: 0;
padding: 20px;
background: #f0f3f5;
padding-bottom: 120px;
/* 为固定输入框预留空间 */
}
.container {
max-width: 100%;
margin: 0 auto;
background: white;
border-radius: 12px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
padding: 2rem;
position: relative;
}
/* 会社ロゴ */
.company-logo {
position: absolute;
top: 20px;
right: 20px;
width: 80px;
height: auto;
}
h1 {
text-align: center;
color: #2c3e50;
margin-bottom: 2rem;
font-weight: 600;
margin-right: 100px;
/* 为图标留出空间 */
}
/* 選択された項目のエリアスタイル */
#selected-terms-box {
position: sticky;
top: 0;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(5px);
z-index: 10;
padding: 1rem;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
margin-bottom: 1.5rem;
border-radius: 8px;
}
.selected-terms-label {
font-weight: 500;
color: #2c3e50;
margin-bottom: 0.5rem;
font-size: 0.9rem;
}
.selected-term {
display: inline-flex;
align-items: center;
padding: 0.4rem 0.8rem;
background: var(--selected-color);
color: white;
border-radius: 20px;
margin: 0.3rem;
font-size: 0.9em;
animation: popIn 0.2s ease;
cursor: pointer;
transition: all 0.2s ease;
}
.selected-term:hover {
background: #c0392b;
transform: scale(1.05);
}
.controls {
display: inline-flex;
gap: 0.5rem;
margin-left: 1rem;
vertical-align: middle;
}
.btn {
padding: 0.6rem 1.2rem;
border: none;
border-radius: 20px;
font-size: 0.9rem;
cursor: pointer;
transition: all 0.2s ease;
font-weight: 500;
}
#generate-btn {
background: var(--primary-color);
color: white;
padding: 1rem 2rem;
/* 放大生成按钮 */
font-size: 1.1rem;
font-weight: 600;
}
#random-btn {
background: var(--success-color);
color: white;
}
#clear-terms-btn {
background: var(--warning-color);
color: white;
}
#clear-images-btn {
background: #95a5a6;
color: white;
}
.btn:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}
.btn:disabled {
background: #bdc3c7;
cursor: not-allowed;
transform: none;
box-shadow: none;
}
@keyframes popIn {
from {
transform: scale(0.8);
opacity: 0;
}
to {
transform: scale(1);
opacity: 1;
}
}
/* プログレスバーのスタイル(非ポップアップ式) */
.progress-container {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
padding: 1rem;
border-radius: 8px;
margin-bottom: 1rem;
color: white;
display: none;
animation: slideDown 0.3s ease;
}
.progress-container.active {
display: block;
}
.progress-bar {
width: 100%;
height: 6px;
background: rgba(255, 255, 255, 0.3);
border-radius: 3px;
overflow: hidden;
margin: 0.5rem 0;
}
.progress-fill {
height: 100%;
background: linear-gradient(90deg, #fff, #f39c12);
width: 0%;
transition: width 0.3s ease;
border-radius: 3px;
}
.progress-info {
display: flex;
justify-content: space-between;
align-items: center;
font-size: 0.9rem;
}
.progress-step {
opacity: 0.9;
}
.fun-fact {
background: rgba(255, 255, 255, 0.1);
padding: 0.5rem;
border-radius: 4px;
margin-top: 0.5rem;
font-style: italic;
font-size: 0.85rem;
animation: fadeIn 0.5s ease;
}
@keyframes slideDown {
from {
opacity: 0;
transform: translateY(-20px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
@keyframes fadeIn {
from {
opacity: 0;
transform: translateY(10px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
/* 項目分類のスタイル */
#term-categories {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
gap: 1.5rem;
}
.category {
background: #ffffff;
border-radius: 8px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
overflow: hidden;
}
.category-header {
padding: 1rem;
background: var(--primary-color);
color: white;
font-weight: 500;
position: sticky;
top: 0;
z-index: 1;
}
.scroll-container {
max-height: 240px;
overflow-y: hidden;
padding: 1rem;
position: relative;
}
.term-item {
padding: 0.8rem 1.2rem;
margin: 0.5rem 0;
border-radius: 6px;
background: #f8f9fa;
cursor: pointer;
transition: all 0.2s ease;
position: relative;
overflow: hidden;
display: flex;
align-items: center;
min-height: 48px;
}
.term-content {
display: flex;
flex-direction: column;
gap: 0.2rem;
}
.japanese {
font-weight: 500;
color: #2c3e50;
}
.term {
font-size: 0.85rem;
color: #7f8c8d;
font-style: italic;
}
.term-item.selected {
background: var(--primary-color);
color: white;
}
.term-item.selected .term {
color: rgba(255, 255, 255, 0.8);
}
.term-item:hover {
transform: translateX(5px);
box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.1);
}
/* レイアウト調整 - 画面全体に広げる */
.main-content {
display: grid;
grid-template-columns: 1fr 500px;
gap: 2rem;
min-height: 70vh;
}
.left-column {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 1.2rem;
align-content: start;
}
.right-column {
background: #f8f9fa;
border-radius: 8px;
padding: 1rem;
display: flex;
flex-direction: column;
}
.images-header {
text-align: center;
color: #2c3e50;
margin-bottom: 1rem;
font-size: 1.1rem;
font-weight: 500;
flex-shrink: 0;
}
/* 画像コンテナを2列に変更 */
#images-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 1rem;
flex: 1;
}
.image-item {
background: white;
border-radius: 8px;
padding: 0.5rem;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
animation: zoomIn 0.3s ease;
align-self: start;
}
.image-item img {
width: 100%;
height: auto;
border-radius: 6px;
display: block;
}
.image-terms {
font-size: 0.75rem;
color: #7f8c8d;
margin-top: 0.5rem;
padding: 0.5rem;
background: #ecf0f1;
border-radius: 4px;
word-wrap: break-word;
line-height: 1.3;
}
.empty-state {
grid-column: 1 / -1;
text-align: center;
color: #7f8c8d;
padding: 2rem;
font-style: italic;
}
@keyframes zoomIn {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
/* レスポンシブデザイン */
@media (max-width: 1400px) {
.main-content {
grid-template-columns: 1fr 450px;
}
}
@media (max-width: 1200px) {
.main-content {
grid-template-columns: 1fr;
}
}
@media (max-width: 768px) {
.container {
padding: 1rem;
}
.company-logo {
width: 60px;
top: 10px;
right: 10px;
}
h1 {
margin-right: 70px;
font-size: 1.5rem;
}
#term-categories {
grid-template-columns: 1fr;
}
#images-container {
grid-template-columns: 1fr;
}
.controls {
flex-direction: column;
gap: 0.5rem;
margin-left: 0;
margin-top: 1rem;
}
.btn {
padding: 0.8rem 1.5rem;
}
#generate-btn {
padding: 1rem 1.5rem;
}
}
/* 画面全体に広げる調整 */
@media (min-width: 1600px) {
.container {
max-width: 95%;
}
.main-content {
grid-template-columns: 1fr 600px;
}
.left-column {
grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
}
/* 手动输入区域样式 */
.manual-input-container {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #ffffff;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
border-top: 1px solid #e1e8ed;
z-index: 100;
padding: 1rem 2rem;
margin: 0;
}
.input-header {
font-weight: 500;
color: #2c3e50;
margin-bottom: 1rem;
font-size: 1rem;
}
.input-wrapper {
display: flex;
gap: 1rem;
margin-bottom: 0.5rem;
}
#manual-term-input {
flex: 1;
padding: 0.8rem 1.2rem;
border: 1px solid #ddd;
border-radius: 20px;
font-size: 0.9rem;
transition: all 0.2s ease;
}
#manual-term-input:focus {
outline: none;
border-color: var(--primary-color);
box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}
#add-term-btn {
padding: 0.8rem 1.5rem;
white-space: nowrap;
}
.input-note {
font-size: 0.8rem;
color: #7f8c8d;
font-style: italic;
}
/* 响应式设计 */
@media (max-width: 768px) {
.input-wrapper {
flex-direction: column;
}
#add-term-btn {
align-self: flex-start;
}
}
</style>
</head>
<body>
<div class="container">
<!-- 公司图标 -->
<img src="https://docs.m5stack.com/assets/m5logo2022.svg" alt="M5Stack Logo" class="company-logo">
<h1>M5Stack LLM8850 画像生成展示</h1>
<div id="selected-terms-box">
<div class="selected-terms-label">選択されたプロンプト Selected Prompts:</div>
<div id="selected-terms-list"></div>
<div class="controls">
<button id="generate-btn" class="btn">今すぐ生成 Generate Now</button>
<button id="random-btn" class="btn">ランダム記述 Random Terms</button>
<button id="clear-terms-btn" class="btn">プロンプトをクリア Clear Terms</button>
<button id="clear-images-btn" class="btn">画像をクリア Clear Images</button>
</div>
</div>
<!-- 非弹出式进度条 -->
<div class="progress-container" id="progress-container">
<div class="progress-info">
<span>AI が創作中... AI is creating...</span>
<span id="progress-percent">0%</span>
</div>
<div class="progress-bar">
<div class="progress-fill" id="progress-fill"></div>
</div>
<div class="progress-step" id="progress-step">初期化中... Initializing...</div>
<div class="fun-fact" id="fun-fact"></div>
</div>
<div class="main-content">
<div class="left-column">
<div id="term-categories"></div>
</div>
<div class="right-column">
<div class="images-header">生成履歴 Generation History</div>
<div id="images-container">
<div class="empty-state">
キーワードを選択し、生成ボタンをクリックして創作を開始してください<br>
Select terms and click generate to start creating
</div>
</div>
</div>
</div>
<!-- 手动输入提示词区域 -->
<div class="manual-input-container">
<div class="input-header">手動入力 Manual Input:</div>
<div class="input-wrapper">
<input type="text" id="manual-term-input"
placeholder="英語の形容詞を入力してください (例: beautiful, dark, fantasy) - Please enter an English adjective">
<button id="add-term-btn" class="btn">追加 Add</button>
</div>
<div class="input-note">※ 単一の英語形容詞を入力してください - Please enter a single English adjective</div>
</div>
</div>
<script>
let scrollControllers = new Map();
// 有趣的提示词汇
const funFacts = [
"あなたの創造的なアイデアを分析中... Analyzing your creative ideas...",
"AIブレインが最適な構図を考え中... AI brain thinking about optimal composition...",
"パレット準備中、完璧な色を探しています... Preparing palette, finding perfect colors...",
"ピクセルスプライトが組み合わせ待ち列に並んでいます... Pixel sprites lining up for combination...",
"魔法で文字を視覚に変換中... Magic transforming text to visuals...",
"クリエイティブファクトリー全速力運転中... Creative factory at full speed...",
"各ディテールを精巧に彫刻中... Every detail carefully crafted...",
"ライトマスターが明暗を調整中... Light master adjusting brightness...",
"ブラシがキャンバス上で舞っています... Brushes dancing on canvas...",
"芸術的インスピレーションが形になりつつあります... Artistic inspiration taking shape...",
"創造性エンジン全開... Creativity engine at full power...",
"美学アルゴリズムがディテールを最適化中... Aesthetic algorithm optimizing details...",
"ビジュアルシンフォニーが演奏開始予定... Visual symphony about to play...",
"想像力が境界を突破中... Imagination breaking boundaries...",
"ミラクルワークショップが魔法をかけ中... Miracle workshop casting magic..."
];
// UNet去噪步骤提示
const unetSteps = [
"入力レイヤーの前処理中... Preprocessing input layers...",
"第1層CNN処理中... Layer 1 CNN processing...",
"第2層特徴抽出中... Layer 2 feature extraction...",
"第3層セマンティック理解... Layer 3 semantic understanding...",
"第4層ディテール最適化... Layer 4 detail optimization...",
"第5層カラー調和... Layer 5 color harmony...",
"第6層テクスチャ生成... Layer 6 texture generation...",
"第7層構図調整... Layer 7 composition adjustment...",
"第8層ライティング処理... Layer 8 lighting processing...",
"第9層ディテール強化... Layer 9 detail enhancement...",
"第10層品質チェック... Layer 10 quality check...",
"第11層スタイル融合... Layer 11 style fusion...",
"第12層最終カラー調整... Layer 12 final coloring...",
"第13層シャープ化処理... Layer 13 sharpening...",
"第14層ノイズ除去... Layer 14 noise removal...",
"第15層コントラスト最適化... Layer 15 contrast optimization...",
"第16層彩度調整... Layer 16 saturation adjustment...",
"第17層最終レンダリング... Layer 17 final rendering...",
"第18層品質検証... Layer 18 quality validation...",
"第19層出力準備... Layer 19 output preparation...",
"第20層処理完了... Layer 20 completion..."
];
async function loadAndDisplayTerms() {
try {
const response = await fetch('./person_jp.json');
const data = await response.json();
const proprietaryTerms = data.prompt_terms.filter(term => term.type === "专用");
const categories = proprietaryTerms.reduce((acc, term) => {
const subtype = term.subtype || "通用 General";
acc[subtype] = acc[subtype] || [];
acc[subtype].push(term);
return acc;
}, {});
const container = document.getElementById('term-categories');
Object.entries(categories).forEach(([subtype, terms]) => {
const category = document.createElement('div');
category.className = 'category';
const header = document.createElement('div');
header.className = 'category-header';
header.textContent = subtype;
const scrollContainer = document.createElement('div');
scrollContainer.className = 'scroll-container';
terms.forEach(term => {
const item = document.createElement('div');
item.className = 'term-item';
item.dataset.term = term.term;
item.innerHTML = `
<div class="term-content">
<div class="japanese">${term.japanese}</div>
<div class="term">${term.term}</div>
</div>
`;
scrollContainer.appendChild(item);
});
category.append(header, scrollContainer);
container.appendChild(category);
if (scrollContainer.scrollHeight > scrollContainer.clientHeight) {
setupAutoScroll(scrollContainer);
}
});
} catch (error) {
console.error('データ読み込み失敗 Data loading failed:', error);
}
}
function setupAutoScroll(container) {
let isPaused = false;
let scrollPos = 0;
const scrollSpeed = 0.5;
const scrollHeight = container.scrollHeight - container.clientHeight;
container.addEventListener('mouseenter', () => isPaused = true);
container.addEventListener('mouseleave', () => isPaused = false);
const scroll = () => {
if (!isPaused && scrollHeight > 0) {
scrollPos = (scrollPos + scrollSpeed) % scrollHeight;
const easedPos = scrollPos < scrollHeight / 2 ? scrollPos : scrollHeight - scrollPos;
container.scrollTop = easedPos;
}
requestAnimationFrame(scroll);
};
scroll();
}
function updateSelections() {
const selectedItems = Array.from(document.querySelectorAll('.term-item.selected'));
const container = document.getElementById('selected-terms-list');
// 保存手动添加的提示词
const manualTerms = [];
const existingSelectedTerms = container.querySelectorAll('.selected-term');
existingSelectedTerms.forEach(termElement => {
const term = termElement.dataset.term;
// 检查是否是手动添加的(没有对应的.term-item)
const hasTermItem = document.querySelector(`.term-item[data-term="${term}"]`);
if (!hasTermItem) {
manualTerms.push({
term: term,
element: termElement.cloneNode(true)
});
}
});
// 重新生成选中提示词列表
container.innerHTML = selectedItems.map(item => {
const japanese = item.querySelector('.japanese').textContent;
const english = item.querySelector('.term').textContent;
return `<span class="selected-term" data-term="${english}">${japanese} ${english}</span>`;
}).join('');
// 重新添加手动添加的提示词
manualTerms.forEach(manualTerm => {
container.appendChild(manualTerm.element);
});
}
function showProgress() {
const container = document.getElementById('progress-container');
const progressFill = document.getElementById('progress-fill');
const progressStep = document.getElementById('progress-step');
const progressPercent = document.getElementById('progress-percent');
const funFact = document.getElementById('fun-fact');
container.classList.add('active');
let currentStep = 0;
const totalSteps = 20;
const stepDuration = 240; //进度条刷新时间
return new Promise((resolve) => {
const interval = setInterval(() => {
currentStep++;
const progress = (currentStep / totalSteps) * 100;
progressFill.style.width = progress + '%';
progressPercent.textContent = Math.round(progress) + '%';
progressStep.textContent = unetSteps[currentStep - 1] || '処理中... Processing...';
if (currentStep % 3 === 0) {
const randomFact = funFacts[Math.floor(Math.random() * funFacts.length)];
funFact.textContent = randomFact;
}
if (currentStep >= totalSteps) {
clearInterval(interval);
progressStep.textContent = 'まもなく完了... Almost done...';
setTimeout(() => {
container.classList.remove('active');
resolve();
}, 500);
}
}, stepDuration);
});
}
function addImageToHistory(selectedTerms) {
const imagesContainer = document.getElementById('images-container');
// 清空初始提示
const emptyState = imagesContainer.querySelector('.empty-state');
if (emptyState) {
emptyState.remove();
}
const imgContainer = document.createElement('div');
imgContainer.className = 'image-item';
const img = document.createElement('img');
img.src = 'generated_image.png?' + new Date().getTime();
img.alt = 'Generated Image';
const termsDiv = document.createElement('div');
termsDiv.className = 'image-terms';
termsDiv.textContent = '关键词 Keywords: ' + selectedTerms.join(', ');
imgContainer.appendChild(img);
imgContainer.appendChild(termsDiv);
// 添加到开头
imagesContainer.prepend(imgContainer);
// 限制历史记录数量
while (imagesContainer.children.length > 20) {
imagesContainer.removeChild(imagesContainer.lastChild);
}
}
function clearAllTerms() {
// 清除所有选中状态
document.querySelectorAll('.term-item.selected').forEach(item => {
item.classList.remove('selected');
});
// 清除手动添加的词条
const container = document.getElementById('selected-terms-list');
const manualTerms = container.querySelectorAll('.selected-term');
manualTerms.forEach(term => {
// 检查是否是手动添加的(没有对应的.term-item)
const termValue = term.dataset.term;
const hasTermItem = document.querySelector(`.term-item[data-term="${termValue}"]`);
if (!hasTermItem) {
term.remove();
}
});
updateSelections();
}
function clearAllImages() {
const imagesContainer = document.getElementById('images-container');
imagesContainer.innerHTML = '<div class="empty-state">項目を選択して生成ボタンをクリックして創作を開始してください<br>Select terms and click generate to start creating</div>';
}
// 随机选择每个类别中的一个提示词
function selectRandomTerms() {
// 先清除所有已选择的词条
clearAllTerms();
// 获取所有类别
const categories = document.querySelectorAll('.category');
const randomTerms = [];
categories.forEach(category => {
const termItems = category.querySelectorAll('.term-item');
if (termItems.length > 0) {
// 从每个类别中随机选择一个
const randomIndex = Math.floor(Math.random() * termItems.length);
const selectedItem = termItems[randomIndex];
selectedItem.classList.add('selected');
randomTerms.push({
japanese: selectedItem.querySelector('.japanese').textContent,
english: selectedItem.querySelector('.term').textContent
});
}
});
// 更新选中的词条显示
updateSelections();
// 可选:显示一个提示告诉用户选择了哪些词条
if (randomTerms.length > 0) {
console.log('ランダムに選ばれた用語:', randomTerms);
// 可以添加一个简短的提示
const notification = document.createElement('div');
notification.style.cssText = `
position: fixed;
top: 20px;
left: 50%;
transform: translateX(-50%);
background: var(--success-color);
color: white;
padding: 0.8rem 1.5rem;
border-radius: 20px;
z-index: 1000;
animation: slideDown 0.3s ease;
`;
notification.textContent = `${randomTerms.length}個の条項がランダムに選択されました Randomly selected ${randomTerms.length} terms`;
document.body.appendChild(notification);
// 3秒后移除提示
setTimeout(() => {
notification.remove();
}, 3000);
}
}
// 事件监听
document.addEventListener('click', (e) => {
// 点击词条选择/取消选择
if (e.target.closest('.term-item')) {
const item = e.target.closest('.term-item');
item.classList.toggle('selected');
updateSelections();
}
// 点击已选择的词条气泡取消选择
if (e.target.closest('.selected-term')) {
const term = e.target.closest('.selected-term').dataset.term;
const termItem = document.querySelector(`.term-item[data-term="${term}"]`);
if (termItem) {
termItem.classList.remove('selected');
updateSelections();
} else {
// 如果是手动添加的提示词,直接移除元素
e.target.closest('.selected-term').remove();
}
}
});
window.addEventListener('load', () => {
loadAndDisplayTerms();
const generateBtn = document.getElementById('generate-btn');
const randomBtn = document.getElementById('random-btn');
const clearTermsBtn = document.getElementById('clear-terms-btn');
const clearImagesBtn = document.getElementById('clear-images-btn');
const addTermBtn = document.getElementById('add-term-btn');
const manualTermInput = document.getElementById('manual-term-input');
// 生成按钮
generateBtn.addEventListener('click', async () => {
// 获取预定义的选中词条
const predefinedTerms = Array.from(document.querySelectorAll('.term-item.selected'))
.map(item => item.dataset.term);
// 获取手动输入的词条
const manualTerms = Array.from(document.querySelectorAll('#selected-terms-list .selected-term'))
.map(item => item.dataset.term)
.filter(term => {
// 过滤掉预定义的词条,避免重复
return !predefinedTerms.includes(term);
});
// 合并所有词条
const selectedTerms = [...predefinedTerms, ...manualTerms];
if (selectedTerms.length === 0) {
alert('少なくとも1つのキーワードを選択してください Please select at least one term');
return;
}
generateBtn.disabled = true;
const progressPromise = showProgress();
try {
const [response] = await Promise.all([
fetch('/generate', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ terms: selectedTerms })
}),
progressPromise
]);
if (response.ok) {
addImageToHistory(selectedTerms);
} else {
const error = await response.json();
alert(`生成失敗 Generation failed: ${error.error}`);
}
} catch (error) {
console.error('生成リクエストに失敗しました Generation request failed:', error);
alert('生成リクエストに失敗しました Generation request failed, please check network connection');
} finally {
generateBtn.disabled = false;
}
});
randomBtn.addEventListener('click', () => {
selectRandomTerms();
});
// 清除提示词按钮
clearTermsBtn.addEventListener('click', clearAllTerms);
// 清除图片按钮
clearImagesBtn.addEventListener('click', () => {
if (confirm('生成されたすべての画像を削除してもよろしいですか? Are you sure you want to clear all generated images?')) {
clearAllImages();
}
});
// 添加手动输入的提示词
addTermBtn.addEventListener('click', () => {
const term = manualTermInput.value.trim();
if (term) {
// 创建一个新的选中项
const selectedTermsList = document.getElementById('selected-terms-list');
const existingTerm = selectedTermsList.querySelector(`.selected-term[data-term="${term}"]`);
// 避免重复添加
if (!existingTerm) {
const span = document.createElement('span');
span.className = 'selected-term';
span.dataset.term = term;
span.textContent = term;
selectedTermsList.appendChild(span);
}
// 清空输入框
manualTermInput.value = '';
}
});
// 回车键添加提示词
manualTermInput.addEventListener('keypress', (e) => {
if (e.key === 'Enter') {
addTermBtn.click();
}
});
});
</script>
</body>
</html>