From 3713bf397c7187911b4e38345b4adfbddbddfffd Mon Sep 17 00:00:00 2001 From: snowy Date: Sat, 27 Apr 2024 11:42:58 +0800 Subject: [PATCH] =?UTF-8?q?:sparkles:=20=E8=BD=BB=E9=9B=AA=E5=A4=A9?= =?UTF-8?q?=E6=B0=94=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vanilla_resource/templates/css/card.css | 8 +++++++- .../resources/vanilla_resource/templates/js/card.js | 12 +++++++++++- liteyuki/utils/base/data.py | 3 +-- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/liteyuki/resources/vanilla_resource/templates/css/card.css b/liteyuki/resources/vanilla_resource/templates/css/card.css index 0455d4ab..79dd1c6d 100644 --- a/liteyuki/resources/vanilla_resource/templates/css/card.css +++ b/liteyuki/resources/vanilla_resource/templates/css/card.css @@ -19,7 +19,13 @@ body { } #author-description { - text-align: center; + display: flex; + justify-content: center; + align-items: center; +} + +#author-text { + margin-left: 20px; color: var(--sub-text-color); font-size: 30px; } \ No newline at end of file diff --git a/liteyuki/resources/vanilla_resource/templates/js/card.js b/liteyuki/resources/vanilla_resource/templates/js/card.js index 2974c9cb..67a03590 100644 --- a/liteyuki/resources/vanilla_resource/templates/js/card.js +++ b/liteyuki/resources/vanilla_resource/templates/js/card.js @@ -13,5 +13,15 @@ document.body.style.backgroundImage = `url(./img/${bgs[Math.floor(Math.random() let descriptionDiv = document.createElement("div"); descriptionDiv.className = 'info-box' descriptionDiv.id = 'author-description' -descriptionDiv.innerText = 'Designed by SnowyKami' +// 添加一副头像且垂直居中 +let avatar = document.createElement("img"); +avatar.src = 'https://q.qlogo.cn/g?b=qq&nk=2751454815&s=640' +avatar.style.height = '50px'; +avatar.style.borderRadius = '50%'; + +let text = document.createElement("div"); +text.id = 'author-text'; +text.innerText = 'Designed by SnowyKami'; +descriptionDiv.appendChild(avatar); +descriptionDiv.appendChild(text); document.body.appendChild(descriptionDiv); diff --git a/liteyuki/utils/base/data.py b/liteyuki/utils/base/data.py index f5dd6e21..326af0bf 100644 --- a/liteyuki/utils/base/data.py +++ b/liteyuki/utils/base/data.py @@ -58,7 +58,7 @@ class Database: """ table_name = model.TABLE_NAME model_type = type(model) - nonebot.logger.debug(f"Selecting {model_type} WHERE {condition} {args}") + nonebot.logger.debug(f"Selecting {model.TABLE_NAME} WHERE {condition.replace('?', '%s') % args}") if not table_name: raise ValueError(f"数据模型{model_type.__name__}未提供表名") @@ -82,7 +82,6 @@ class Database: """增/改操作 Args: *args: - Returns: """ table_list = [item[0] for item in self.cursor.execute("SELECT name FROM sqlite_master WHERE type='table'").fetchall()]