From c14b939e3ddfd092baa0c17819665c69cd5b27e2 Mon Sep 17 00:00:00 2001 From: "675061370@qq.com" Date: Sat, 14 Sep 2024 22:34:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common.php | 7 +++++++ public/static/index/css/app.css | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/common.php b/app/common.php index a1d1317..f722b12 100644 --- a/app/common.php +++ b/app/common.php @@ -754,11 +754,18 @@ function filterAndExtractWords(array $result) */ function highlightKeywords($title, $searchTitle) { + $originalTitle = $title; // 保存原始标题 + // 使用正则表达式来高亮所有关键词 foreach ($searchTitle as $keyword) { $title = preg_replace('/(' . preg_quote($keyword, '/') . ')/i', '$1', $title); } + // 如果有关键词被高亮,添加

标签 + if ($title !== $originalTitle) { + $title = '

' . $title . '

'; + } + return $title; } diff --git a/public/static/index/css/app.css b/public/static/index/css/app.css index a7798ca..e75faf7 100644 --- a/public/static/index/css/app.css +++ b/public/static/index/css/app.css @@ -477,8 +477,12 @@ a:hover { font-weight: bold; padding-right: 42px; padding-bottom: 4px; + color: var(--theme-theme); } -.listBox .left .list .item .title span{ +.listBox .left .list .item .title p{ + color: var(--theme-color); +} +.listBox .left .list .item .title p span{ color: var(--theme-theme); } .listBox .left .list .item .btns{ @@ -489,11 +493,11 @@ a:hover { .listBox .left .list .item .btns .btn{ position: relative; margin-right: 35px; - color: var(--theme-theme); - opacity: .95; cursor: pointer; display: inline-flex; align-items: center; + font-weight: 500; + color: var(--theme-color); } .listBox .left .list .item .btns .btn .iconfont{ font-size: 18px;