|
|
@@ -3,7 +3,7 @@
|
|
|
<head>
|
|
|
<meta charset="UTF-8">
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
- <title>Pokemon Card Search</title>
|
|
|
+ <title>宝可梦搜索服务</title>
|
|
|
<style>
|
|
|
:root {
|
|
|
--primary-color: #4F46E5;
|
|
|
@@ -69,55 +69,89 @@
|
|
|
padding: 2rem;
|
|
|
border-radius: 16px;
|
|
|
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
|
|
|
- max-width: 600px;
|
|
|
+ max-width: 800px; /* 稍微加宽一点,让大图看起来更舒服 */
|
|
|
margin: 0 auto 2rem auto;
|
|
|
- min-height: 300px; /* 防止切换时高度跳动太大 */
|
|
|
+ min-height: 300px;
|
|
|
}
|
|
|
|
|
|
.panel-content { display: none; }
|
|
|
.panel-content.active { display: block; animation: fadeIn 0.3s; }
|
|
|
|
|
|
- /* --- 图片上传区域样式 (保持不变) --- */
|
|
|
+ /* --- 图片上传区域样式 (重点修改部分) --- */
|
|
|
.upload-zone {
|
|
|
border: 2px dashed #d1d5db;
|
|
|
border-radius: 12px;
|
|
|
- padding: 2rem;
|
|
|
+ padding: 1rem;
|
|
|
margin-bottom: 1.5rem;
|
|
|
cursor: pointer;
|
|
|
transition: all 0.3s ease;
|
|
|
- text-align: center;
|
|
|
background-color: #fff;
|
|
|
+
|
|
|
+ /* Flex 布局实现绝对居中 */
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+
|
|
|
+ /* 设定一个最小高度 */
|
|
|
+ min-height: 400px;
|
|
|
+ position: relative;
|
|
|
}
|
|
|
+
|
|
|
.upload-zone:hover, .upload-zone.drag-active {
|
|
|
border-color: var(--primary-color);
|
|
|
background-color: #f9fafb;
|
|
|
}
|
|
|
+
|
|
|
+ /* 占位符样式 */
|
|
|
+ #upload-placeholder {
|
|
|
+ text-align: center;
|
|
|
+ pointer-events: none;
|
|
|
+ }
|
|
|
+
|
|
|
+ /* 预览图片样式 */
|
|
|
#preview-img {
|
|
|
- max-width: 100%;
|
|
|
- max-height: 200px;
|
|
|
- border-radius: 8px;
|
|
|
- margin-top: 1rem;
|
|
|
display: none;
|
|
|
- box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
|
+ /* 只要不超过容器,尽可能大 */
|
|
|
+ max-width: 95%;
|
|
|
+ max-height: 450px;
|
|
|
+ object-fit: contain; /* 保持比例 */
|
|
|
+
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 10px 25px rgba(0,0,0,0.15);
|
|
|
+ animation: popIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
|
|
|
}
|
|
|
|
|
|
- /* --- 文本搜索区域样式 (新增) --- */
|
|
|
- .text-search-group {
|
|
|
- display: flex;
|
|
|
- flex-direction: column;
|
|
|
+ /* --- 文本搜索区域样式 --- */
|
|
|
+ .text-search-row {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: 2fr 1fr;
|
|
|
gap: 1rem;
|
|
|
margin-bottom: 1.5rem;
|
|
|
- text-align: left;
|
|
|
}
|
|
|
- .form-input {
|
|
|
+
|
|
|
+ .form-group {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 0.5rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ label {
|
|
|
+ font-weight: 600;
|
|
|
+ color: var(--text-main);
|
|
|
+ font-size: 0.9rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .form-input, .form-select {
|
|
|
width: 100%;
|
|
|
padding: 0.8rem 1rem;
|
|
|
border: 1px solid var(--border-color);
|
|
|
border-radius: 8px;
|
|
|
font-size: 1rem;
|
|
|
+ background-color: #fff;
|
|
|
transition: border-color 0.2s;
|
|
|
}
|
|
|
- .form-input:focus {
|
|
|
+ .form-input:focus, .form-select:focus {
|
|
|
outline: none;
|
|
|
border-color: var(--primary-color);
|
|
|
box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
|
|
|
@@ -130,12 +164,14 @@
|
|
|
align-items: center;
|
|
|
gap: 1rem;
|
|
|
margin-top: 1rem;
|
|
|
+ padding-top: 1rem;
|
|
|
+ border-top: 1px solid #f3f4f6;
|
|
|
}
|
|
|
.search-btn {
|
|
|
background-color: var(--primary-color);
|
|
|
color: white;
|
|
|
border: none;
|
|
|
- padding: 0.75rem 2rem;
|
|
|
+ padding: 0.75rem 2.5rem;
|
|
|
border-radius: 8px;
|
|
|
font-size: 1rem;
|
|
|
font-weight: 600;
|
|
|
@@ -143,9 +179,10 @@
|
|
|
transition: background-color 0.2s;
|
|
|
display: inline-flex;
|
|
|
align-items: center;
|
|
|
+ box-shadow: 0 4px 6px rgba(79, 70, 229, 0.2);
|
|
|
}
|
|
|
- .search-btn:hover { background-color: var(--primary-hover); }
|
|
|
- .search-btn:disabled { background-color: #9ca3af; cursor: not-allowed; }
|
|
|
+ .search-btn:hover { background-color: var(--primary-hover); transform: translateY(-1px); }
|
|
|
+ .search-btn:disabled { background-color: #9ca3af; cursor: not-allowed; transform: none; box-shadow: none;}
|
|
|
|
|
|
.limit-input {
|
|
|
padding: 0.75rem;
|
|
|
@@ -164,9 +201,9 @@
|
|
|
color: #3730a3;
|
|
|
border-radius: 8px;
|
|
|
font-weight: 500;
|
|
|
- display: none; /* 默认隐藏 */
|
|
|
- justify-content: space-between;
|
|
|
- align-items: center;
|
|
|
+ display: none;
|
|
|
+ justify-content: center;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
|
|
|
/* --- 结果卡片样式 --- */
|
|
|
@@ -191,17 +228,17 @@
|
|
|
.card-img-wrapper {
|
|
|
width: 100%;
|
|
|
height: 280px;
|
|
|
- background-color: #e5e7eb;
|
|
|
+ background-color: #f8fafc;
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
justify-content: center;
|
|
|
- overflow: hidden;
|
|
|
- position: relative;
|
|
|
+ padding: 10px;
|
|
|
}
|
|
|
.card-img-wrapper img {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
object-fit: contain;
|
|
|
+ filter: drop-shadow(0 4px 6px rgba(0,0,0,0.1));
|
|
|
}
|
|
|
.card-info { padding: 1rem; }
|
|
|
.card-title {
|
|
|
@@ -220,9 +257,19 @@
|
|
|
justify-content: space-between;
|
|
|
margin-bottom: 0.5rem;
|
|
|
}
|
|
|
+ .lang-tag {
|
|
|
+ background: #eee;
|
|
|
+ padding: 2px 6px;
|
|
|
+ border-radius: 4px;
|
|
|
+ font-size: 12px;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #555;
|
|
|
+ }
|
|
|
+ .lang-tag.us { background: #dbeafe; color: #1e40af; }
|
|
|
+ .lang-tag.tc { background: #fee2e2; color: #991b1b; }
|
|
|
|
|
|
- /* 相似度条 (仅在图片搜索时显示) */
|
|
|
- .similarity-wrapper { display: none; }
|
|
|
+ /* 相似度条 */
|
|
|
+ .similarity-wrapper { display: none; margin-top: 0.5rem; }
|
|
|
.show-score .similarity-wrapper { display: block; }
|
|
|
|
|
|
.score-bar-bg {
|
|
|
@@ -230,7 +277,6 @@
|
|
|
background-color: #e5e7eb;
|
|
|
border-radius: 3px;
|
|
|
overflow: hidden;
|
|
|
- margin-top: 0.5rem;
|
|
|
}
|
|
|
.score-bar-fill {
|
|
|
height: 100%;
|
|
|
@@ -245,7 +291,6 @@
|
|
|
text-align: right;
|
|
|
}
|
|
|
|
|
|
- /* Spinner */
|
|
|
.spinner {
|
|
|
border: 3px solid rgba(255,255,255,0.3);
|
|
|
border-radius: 50%;
|
|
|
@@ -258,14 +303,21 @@
|
|
|
}
|
|
|
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
|
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
|
|
|
+ @keyframes popIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
|
|
+
|
|
|
+ @media (max-width: 640px) {
|
|
|
+ .text-search-row { grid-template-columns: 1fr; }
|
|
|
+ .upload-zone { min-height: 250px; }
|
|
|
+ #preview-img { max-height: 250px; }
|
|
|
+ }
|
|
|
</style>
|
|
|
</head>
|
|
|
<body>
|
|
|
|
|
|
<div class="container">
|
|
|
<header>
|
|
|
- <h1>Pokédex Search</h1>
|
|
|
- <p>探索宝可梦卡片数据库</p>
|
|
|
+ <h1>宝可梦搜索服务</h1>
|
|
|
+ <p>搜索宝可梦卡片数据库</p>
|
|
|
</header>
|
|
|
|
|
|
<!-- Tab 切换 -->
|
|
|
@@ -276,40 +328,57 @@
|
|
|
|
|
|
<div class="search-panel-container">
|
|
|
|
|
|
- <!-- 面板 1: 图片搜索 -->
|
|
|
+ <!-- 面板 1: 图片搜索 (CSS 已调整,支持大图居中) -->
|
|
|
<div id="panel-img" class="panel-content active">
|
|
|
<div class="upload-zone" id="dropZone">
|
|
|
<div id="upload-placeholder">
|
|
|
- <svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
|
+ <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="#9ca3af" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" style="margin-bottom:1rem;">
|
|
|
<rect x="3" y="3" width="18" height="18" rx="2" ry="2"></rect>
|
|
|
<circle cx="8.5" cy="8.5" r="1.5"></circle>
|
|
|
<polyline points="21 15 16 10 5 21"></polyline>
|
|
|
</svg>
|
|
|
- <span style="display:block; margin-top:0.5rem; color:#6b7280;">点击或拖拽上传图片</span>
|
|
|
+ <span style="display:block; color:#6b7280; font-size:1.1rem;">点击或拖拽上传图片</span>
|
|
|
</div>
|
|
|
+
|
|
|
<img id="preview-img" src="" alt="Preview">
|
|
|
<input type="file" id="imgInput" accept="image/*" style="display:none">
|
|
|
</div>
|
|
|
|
|
|
<div class="controls">
|
|
|
- <label>显示数量:</label>
|
|
|
- <input type="number" id="imgTopN" class="limit-input" value="5" min="1" max="20">
|
|
|
+ <div style="display:flex; align-items:center; gap:0.5rem;">
|
|
|
+ <label>显示数量:</label>
|
|
|
+ <input type="number" id="imgTopN" class="limit-input" value="5" min="1" max="20">
|
|
|
+ </div>
|
|
|
<button class="search-btn" onclick="searchImage()" id="btnImgSearch">
|
|
|
<div class="spinner"></div> 搜索相似
|
|
|
</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
- <!-- 面板 2: 文本搜索 (新功能) -->
|
|
|
+ <!-- 文本搜索 -->
|
|
|
<div id="panel-text" class="panel-content">
|
|
|
- <div class="text-search-group">
|
|
|
- <label for="cardNameInput" style="font-weight:600; color:var(--text-main)">卡片名称 (模糊匹配):</label>
|
|
|
- <input type="text" id="cardNameInput" class="form-input" placeholder="例如: Pikachu, Charizard...">
|
|
|
+ <div class="text-search-row">
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="cardNameInput">卡片名称 (模糊匹配)</label>
|
|
|
+ <input type="text" id="cardNameInput" class="form-input" placeholder="例如: Charizard, Pikachu...">
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 语言选择 -->
|
|
|
+ <div class="form-group">
|
|
|
+ <label for="langInput">语言区域</label>
|
|
|
+ <select id="langInput" class="form-select">
|
|
|
+ <option value="">全部语言 (All)</option>
|
|
|
+ <option value="us">🇺🇸 英文 (US)</option>
|
|
|
+ <option value="tc">🇨🇳 繁体中文 (TC)</option>
|
|
|
+ </select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="controls">
|
|
|
- <label>最大返回:</label>
|
|
|
- <input type="number" id="textLimit" class="limit-input" value="20" min="1" max="100">
|
|
|
+ <div style="display:flex; align-items:center; gap:0.5rem;">
|
|
|
+ <label>最大返回:</label>
|
|
|
+ <input type="number" id="textLimit" class="limit-input" value="20" min="1" max="100">
|
|
|
+ </div>
|
|
|
<button class="search-btn" onclick="searchByMetadata()" id="btnTextSearch">
|
|
|
<div class="spinner"></div> 查询数据
|
|
|
</button>
|
|
|
@@ -330,7 +399,7 @@
|
|
|
</div>
|
|
|
|
|
|
<script>
|
|
|
- // --- Tab 切换逻辑 ---
|
|
|
+ // --- Tab 切换 ---
|
|
|
function switchTab(type) {
|
|
|
document.querySelectorAll('.tab-btn').forEach(b => b.classList.remove('active'));
|
|
|
document.querySelectorAll('.panel-content').forEach(p => p.classList.remove('active'));
|
|
|
@@ -341,35 +410,27 @@
|
|
|
} else {
|
|
|
document.querySelector('.tab-btn:nth-child(2)').classList.add('active');
|
|
|
document.getElementById('panel-text').classList.add('active');
|
|
|
- document.getElementById('cardNameInput').focus();
|
|
|
}
|
|
|
- // 切换时清空结果,避免混淆
|
|
|
- document.getElementById('resultsGrid').innerHTML = '';
|
|
|
- document.getElementById('statsBar').style.display = 'none';
|
|
|
+ // 这里不清空
|
|
|
}
|
|
|
|
|
|
- // --- 图片上传相关逻辑 (Drag & Drop) ---
|
|
|
+ // --- 图片处理 (Drag & Drop) ---
|
|
|
const dropZone = document.getElementById('dropZone');
|
|
|
const imgInput = document.getElementById('imgInput');
|
|
|
const previewImg = document.getElementById('preview-img');
|
|
|
const placeholder = document.getElementById('upload-placeholder');
|
|
|
|
|
|
- ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(eventName => {
|
|
|
- dropZone.addEventListener(eventName, (e) => { e.preventDefault(); e.stopPropagation(); }, false);
|
|
|
+ ['dragenter', 'dragover', 'dragleave', 'drop'].forEach(e => {
|
|
|
+ dropZone.addEventListener(e, (ev) => { ev.preventDefault(); ev.stopPropagation(); }, false);
|
|
|
});
|
|
|
|
|
|
- ['dragenter', 'dragover'].forEach(eventName => {
|
|
|
- dropZone.addEventListener(eventName, () => dropZone.classList.add('drag-active'), false);
|
|
|
- });
|
|
|
- ['dragleave', 'drop'].forEach(eventName => {
|
|
|
- dropZone.addEventListener(eventName, () => dropZone.classList.remove('drag-active'), false);
|
|
|
- });
|
|
|
+ ['dragenter', 'dragover'].forEach(() => dropZone.classList.add('drag-active'));
|
|
|
+ ['dragleave', 'drop'].forEach(() => dropZone.classList.remove('drag-active'));
|
|
|
|
|
|
dropZone.addEventListener('drop', (e) => {
|
|
|
- const files = e.dataTransfer.files;
|
|
|
- if (files.length) {
|
|
|
- imgInput.files = files;
|
|
|
- updatePreview(files[0]);
|
|
|
+ if (e.dataTransfer.files.length) {
|
|
|
+ imgInput.files = e.dataTransfer.files;
|
|
|
+ updatePreview(imgInput.files[0]);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
@@ -383,7 +444,7 @@
|
|
|
previewImg.src = URL.createObjectURL(file);
|
|
|
}
|
|
|
|
|
|
- // --- 功能 1: 图片搜索 (原有) ---
|
|
|
+ // --- API 1: 图像搜索 ---
|
|
|
async function searchImage() {
|
|
|
if (!imgInput.files[0]) return alert("请先上传图片!");
|
|
|
|
|
|
@@ -396,15 +457,12 @@
|
|
|
const topN = document.getElementById('imgTopN').value;
|
|
|
|
|
|
const res = await fetch(`/api/search/image?top_k=${topN}`, {
|
|
|
- method: 'POST',
|
|
|
- body: formData
|
|
|
+ method: 'POST', body: formData
|
|
|
});
|
|
|
-
|
|
|
const data = await res.json();
|
|
|
|
|
|
- // 图片搜索通常没有 total 统计,显示返回数量即可
|
|
|
- showStats(`🔍 相似度匹配完成,显示前 ${data.results.length} 个结果`);
|
|
|
- renderResults(data.results, true); // true 表示显示分数条
|
|
|
+ showStats(`🔍 图像匹配完成,显示最相似的 <b>${data.results.length}</b> 张卡片`);
|
|
|
+ renderResults(data.results, true);
|
|
|
|
|
|
} catch (e) {
|
|
|
alert("搜索失败: " + e.message);
|
|
|
@@ -413,36 +471,31 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // --- 功能 2: 元数据搜索 (新增) ---
|
|
|
+ // --- API 2: 元数据搜索 (新增 lang 参数) ---
|
|
|
async function searchByMetadata() {
|
|
|
const name = document.getElementById('cardNameInput').value.trim();
|
|
|
+ const lang = document.getElementById('langInput').value; // 获取语言
|
|
|
const limit = document.getElementById('textLimit').value;
|
|
|
const btn = document.getElementById('btnTextSearch');
|
|
|
|
|
|
setLoading(btn, true);
|
|
|
|
|
|
try {
|
|
|
- // 构建 URL Query Params
|
|
|
+ // 构造 URL 参数
|
|
|
const params = new URLSearchParams({ limit: limit });
|
|
|
if (name) params.append('card_name', name);
|
|
|
+ if (lang) params.append('lang', lang); // 只有选中了才传
|
|
|
|
|
|
- // 注意:这里使用你提供的 POST 接口
|
|
|
const res = await fetch(`/api/search/state?${params.toString()}`, {
|
|
|
- method: 'POST',
|
|
|
- headers: { 'Accept': 'application/json' },
|
|
|
- body: '' // POST 请求体为空
|
|
|
+ method: 'POST', headers: { 'Accept': 'application/json' }, body: ''
|
|
|
});
|
|
|
|
|
|
- if (!res.ok) throw new Error("API Request Failed");
|
|
|
-
|
|
|
+ if (!res.ok) throw new Error("API Error");
|
|
|
const data = await res.json();
|
|
|
|
|
|
- // 显示统计信息
|
|
|
if (data.total !== undefined) {
|
|
|
- showStats(`📊 数据库中符合条件的共有 <b>${data.total}</b> 条,当前展示前 <b>${data.returned_count}</b> 条`);
|
|
|
+ showStats(`📊 数据库共找到 <b>${data.total}</b> 条,当前展示前 <b>${data.returned_count}</b> 条`);
|
|
|
}
|
|
|
-
|
|
|
- // 渲染结果 (false 表示不显示分数条)
|
|
|
renderResults(data.data || [], false);
|
|
|
|
|
|
} catch (e) {
|
|
|
@@ -453,7 +506,7 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // --- 通用渲染函数 ---
|
|
|
+ // --- 渲染逻辑 ---
|
|
|
function renderResults(items, showScore) {
|
|
|
const grid = document.getElementById('resultsGrid');
|
|
|
grid.innerHTML = '';
|
|
|
@@ -464,33 +517,30 @@
|
|
|
}
|
|
|
|
|
|
items.forEach((item, index) => {
|
|
|
- // 处理相似度分数 (仅图片搜索有)
|
|
|
let scoreHtml = '';
|
|
|
if (showScore && item.score !== undefined) {
|
|
|
const pct = (item.score * 100).toFixed(1);
|
|
|
scoreHtml = `
|
|
|
<div class="similarity-wrapper">
|
|
|
- <div class="score-bar-bg">
|
|
|
- <div class="score-bar-fill" style="width: ${pct}%"></div>
|
|
|
- </div>
|
|
|
+ <div class="score-bar-bg"><div class="score-bar-fill" style="width:${pct}%"></div></div>
|
|
|
<div class="score-text">相似度: ${pct}%</div>
|
|
|
- </div>
|
|
|
- `;
|
|
|
+ </div>`;
|
|
|
}
|
|
|
|
|
|
- const cardNumDisplay = (item.card_num && item.card_num !== -1) ? `#${item.card_num}` : '';
|
|
|
+ // 简单的语言标签处理
|
|
|
+ const langCode = item.lang ? item.lang.toLowerCase() : '';
|
|
|
+ const langClass = (langCode === 'us' || langCode === 'tc') ? langCode : '';
|
|
|
|
|
|
const html = `
|
|
|
<div class="result-card" style="opacity:0; animation:fadeIn 0.5s forwards ${index * 0.05}s">
|
|
|
<div class="card-img-wrapper">
|
|
|
- <img src="${item.img_url}" loading="lazy"
|
|
|
- onerror="this.src='https://via.placeholder.com/200x280?text=No+Image'">
|
|
|
+ <img src="${item.img_url}" loading="lazy" onerror="this.src='https://via.placeholder.com/200x280?text=No+Image'">
|
|
|
</div>
|
|
|
<div class="card-info">
|
|
|
<div class="card-title" title="${item.card_name}">${item.card_name}</div>
|
|
|
<div class="card-meta">
|
|
|
- <span style="background:#eee; padding:2px 6px; border-radius:4px; font-size:12px;">${item.lang ? item.lang.toUpperCase() : 'UNK'}</span>
|
|
|
- <span>${cardNumDisplay}</span>
|
|
|
+ <span class="lang-tag ${langClass}">${item.lang ? item.lang.toUpperCase() : 'UNK'}</span>
|
|
|
+ <span>${item.card_num ? '#' + item.card_num : ''}</span>
|
|
|
</div>
|
|
|
<div class="result-card-class ${showScore ? 'show-score' : ''}">
|
|
|
${scoreHtml}
|
|
|
@@ -502,17 +552,14 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- // --- 辅助 UI 函数 ---
|
|
|
function setLoading(btn, isLoading) {
|
|
|
btn.disabled = isLoading;
|
|
|
btn.querySelector('.spinner').style.display = isLoading ? 'inline-block' : 'none';
|
|
|
}
|
|
|
|
|
|
- function showStats(htmlContent) {
|
|
|
- const bar = document.getElementById('statsBar');
|
|
|
- const text = document.getElementById('statsText');
|
|
|
- bar.style.display = 'flex';
|
|
|
- text.innerHTML = htmlContent;
|
|
|
+ function showStats(html) {
|
|
|
+ document.getElementById('statsBar').style.display = 'flex';
|
|
|
+ document.getElementById('statsText').innerHTML = html;
|
|
|
}
|
|
|
</script>
|
|
|
</body>
|