From 7c492cb4088a9840499a6880c4e2d7df46f69aff Mon Sep 17 00:00:00 2001 From: wzj <244142824@qq.com> Date: Tue, 15 Jul 2025 17:38:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E7=B1=BB=E9=A1=B5?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=BA=94=E7=94=A8=E9=80=89=E6=8B=A9=E5=9B=BE?= =?UTF-8?q?=E6=A0=87=E7=9A=84=E6=A8=A1=E6=80=81=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/categories.html | 118 ++++++++++++++++++++++++++++++++++++-- templates/index.html | 2 +- 2 files changed, 114 insertions(+), 6 deletions(-) diff --git a/templates/categories.html b/templates/categories.html index 0f03319..802ffa0 100644 --- a/templates/categories.html +++ b/templates/categories.html @@ -46,7 +46,7 @@ -
@@ -327,5 +351,89 @@ function setCategory(mainId, subId) { document.getElementById('modalAppMainCategory').value = mainId; document.getElementById('modalAppSubCategory').value = subId; } + +function filterIcons() { + const searchTerm = document.getElementById('iconSearch').value.toLowerCase(); + const iconItems = document.querySelectorAll('.icon-item'); + + iconItems.forEach(item => { + const iconName = item.getAttribute('data-icon').toLowerCase(); + const iconComment = item.getAttribute('data-comment').toLowerCase(); + if (iconName.includes(searchTerm) || iconComment.includes(searchTerm)) { + item.style.display = 'block'; + } else { + item.style.display = 'none'; + } + }); +} + +function selectIcon(element, icon, comment) { + // 移除所有选中状态 + document.querySelectorAll('.icon-card').forEach(card => { + card.classList.remove('border-primary', 'bg-light'); + }); + + // 添加选中状态 + element.classList.add('border-primary', 'bg-light'); + + // 更新隐藏的select元素 + const select = document.getElementById('iconSelect'); + select.value = icon; + + // 显示选中的图标信息 + const selectedIconInfo = document.getElementById('selectedIconInfo'); + document.getElementById('selectedIconCode').textContent = icon; + document.getElementById('selectedIconComment').textContent = " - " + comment; + selectedIconInfo.style.display = 'block'; + + // 触发change事件 + const event = new Event('change'); + select.dispatchEvent(event); +} + +// 初始化时隐藏select元素并显示图标网格 +document.addEventListener('DOMContentLoaded', function() { + const select = document.getElementById('iconSelect'); + select.style.display = 'none'; +}); + + {% endblock %} \ No newline at end of file diff --git a/templates/index.html b/templates/index.html index bb493ea..e773492 100644 --- a/templates/index.html +++ b/templates/index.html @@ -831,7 +831,7 @@ body.dark-theme .secondary-filters-container::after { .app-description { position: absolute; bottom: calc(100% + 10px); - left: 20px; + left: -15px; transform: none; background-color: var(--tooltip-bg); color: var(--tooltip-text);