update theme

This commit is contained in:
2026-02-10 21:17:10 +08:00
parent 522a86b511
commit 4fff64f05f
6 changed files with 106 additions and 39 deletions

View File

@@ -622,7 +622,7 @@ search:
share: share:
# Choose: sharejs / addtoany # Choose: sharejs / addtoany
# Leave it empty if you don't need share # Leave it empty if you don't need share
use: sharejs use: web_share
# Share.js # Share.js
# https://github.com/overtrue/share.js # https://github.com/overtrue/share.js
@@ -1185,7 +1185,7 @@ inject:
- <script src="https://cdn.jsdmirror.com/npm/aplayer/dist/APlayer.min.js"></script> - <script src="https://cdn.jsdmirror.com/npm/aplayer/dist/APlayer.min.js"></script>
- <script src="https://cdn.jsdmirror.com/npm/meting/dist/Meting.min.js"></script> - <script src="https://cdn.jsdmirror.com/npm/meting/dist/Meting.min.js"></script>
- <script src="https://cdn.jsdmirror.com/gh/bishshi/welcomemessage/txmap.js"></script> - <script src="https://cdn.jsdmirror.com/gh/bishshi/welcomemessage/txmap.js"></script>
- <script src="https://cdn.jsdmirror.com/gh/bishshi/rightmenu/rightmenu.js"></script> - <script src="https://cdn.jsdmirror.com/gh/bishshi/rightmenu@1.2/rightmenu.js"></script>
- <script src="https://cdn.jsdmirror.com/gh/bishshi/sidecalendar/calendar.js"></script> - <script src="https://cdn.jsdmirror.com/gh/bishshi/sidecalendar/calendar.js"></script>
- <script src="https://cdn.jsdmirror.com/npm/chinese-lunar@0.1.4/lib/chinese-lunar.js"></script> - <script src="https://cdn.jsdmirror.com/npm/chinese-lunar@0.1.4/lib/chinese-lunar.js"></script>
- <script src="https://cdn.jsdmirror.com/npm/instantsearch.js@4.56.0"></script> - <script src="https://cdn.jsdmirror.com/npm/instantsearch.js@4.56.0"></script>

View File

@@ -6,4 +6,6 @@ if use
when 'addtoany' when 'addtoany'
!=partial('includes/third-party/share/addtoany', {}, {cache: true}) !=partial('includes/third-party/share/addtoany', {}, {cache: true})
when 'sharejs' when 'sharejs'
include ./share-js.pug include ./share-js.pug
when 'web_share'
include ./web_share.pug

View File

@@ -0,0 +1,53 @@
//- web_share.pug
style.
#web-share-btn {
background: var(--btn-bg);
color: var(--btn-color);
border: none;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
transition: all 0.3s;
}
#web-share-btn:hover {
background: var(--btn-hover-color);
}
#web-share-component
button#web-share-btn(title='分享本文')
i.fas.fa-share-alt
span= ' ' + _p('分享')
script.
(() => {
const setupWebShare = () => {
const btn = document.getElementById('web-share-btn')
if (!btn) return
// 点击事件处理
btn.addEventListener('click', async () => {
if (navigator.share) {
try {
await navigator.share({
title: '!{page.title || config.title}',
text: '!{truncate(strip_html(page.content), {length: 100})}',
url: window.location.href
})
} catch (err) {
console.log('分享取消或失败', err)
}
} else {
// 降级处理:比如弹出提示或复制链接
const shareData = window.location.href
navigator.clipboard.writeText(shareData).then(() => {
btf.snackbarShow('系统不支持分享,已将链接复制到剪贴板')
})
}
})
}
// 考虑到 Butterfly 的 Pjax 跳转,需要重新绑定
setupWebShare()
document.addEventListener('pjax:complete', setupWebShare)
})()

View File

@@ -1,14 +1,12 @@
[data-theme=light] { [data-theme=light] {
--fontcolor: #363636; --fontcolor: #363636;
--text: rgba(60, 60, 67, 0.6); --text: rgba(60, 60, 67, 0.6);
--btn-bg: #edf0f7;
--bg: #edf0f7; --bg: #edf0f7;
} }
[data-theme=dark] { [data-theme=dark] {
--fontcolor: #F7F7FA; --fontcolor: #F7F7FA;
--text: #a1a2b8; --text: #a1a2b8;
--btn-bg: #30343f;
--bg: #30343f; --bg: #30343f;
} }
div#poem_sentence{ div#poem_sentence{
@@ -42,4 +40,28 @@ div#poem_dynasty{
background: var(-btn-bg); background: var(-btn-bg);
color: var(--fontcolor); color: var(--fontcolor);
border-radius: 8px; border-radius: 8px;
}
#card-poem{
display: flex;
flex-direction: column;
padding: 0.5rem!important;
min-height: 130px;
background: linear-gradient(-45deg, rgba(255, 255, 255, .7),
rgba(255, 255, 255, .8),
rgba(255, 255, 255, .8),
rgba(255, 255, 255, .7))!important;
backdrop-filter: blur(10px);
}
[data-theme=dark] #card-poem{
display: flex;
flex-direction: column;
padding: 0.5rem!important;
min-height: 130px;
background: linear-gradient(-45deg, rgba(24, 40, 72, .7),
rgba(35, 37, 58, .8),
rgba(35, 37, 58, .8),
rgba(24, 40, 72, .7))!important;
backdrop-filter: blur(10px);
} }

View File

@@ -54,12 +54,17 @@
} }
} }
/* 重点修改bber-talk 的磨砂玻璃背景 */
#bber-talk { #bber-talk {
/* border-radius: 8px; */ /* 统一磨砂玻璃效果 */
/* background: var(--card-bg); */ background: linear-gradient(-45deg, rgba(255, 255, 255, .7), rgba(255, 255, 255, .8), rgba(255, 255, 255, .8), rgba(255, 255, 255, .7)) !important;
/* box-shadow: none; */ backdrop-filter: blur(10px);
-webkit-backdrop-filter: blur(10px);
border-radius: 12px; /* 给哔哔栏加一点圆角,更符合玻璃质感 */
border: 1px solid rgba(255, 255, 255, 0.3); /* 增加边缘高光 */
box-sizing: border-box; box-sizing: border-box;
/* transition: all .3s ease-in-out; */
cursor: pointer; cursor: pointer;
width: 100%; width: 100%;
min-height: 50px; min-height: 50px;
@@ -68,6 +73,18 @@
align-items: center; align-items: center;
overflow: hidden; overflow: hidden;
font-weight: 700; font-weight: 700;
transition: all .3s ease-in-out;
}
/* 暗黑模式适配 */
[data-theme=dark] #bber-talk {
background: linear-gradient(-45deg, rgba(24, 40, 72, .7), rgba(35, 37, 58, .8), rgba(35, 37, 58, .8), rgba(24, 40, 72, .7)) !important;
border: 1px solid rgba(255, 255, 255, 0.1);
}
#bber-talk:hover {
transform: translateY(-2px); /* 悬停微动,增加交互感 */
box-shadow: 0 8px 20px rgba(0,0,0,0.1);
} }
#bber-talk, #bber-talk,
@@ -120,4 +137,4 @@
text-align: center; text-align: center;
margin-right: 20px; margin-right: 20px;
} }
} }

View File

@@ -23,8 +23,7 @@
rgba(255, 255, 255, 0.0), rgba(255, 255, 255, 0.0),
rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3),
rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6),
rgba(255, 255, 255, 0.7)), rgba(255, 255, 255, 0.7)); /* 鼠标悬停时显示的背景图片 */
url('/config/img/dog.jpg'); /* 鼠标悬停时显示的背景图片 */
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
opacity: 0.5; opacity: 0.5;
@@ -37,8 +36,7 @@
rgba(24, 40, 72, .1), rgba(24, 40, 72, .1),
rgba(35, 37, 58, .3), rgba(35, 37, 58, .3),
rgba(35, 37, 58, .6), rgba(35, 37, 58, .6),
rgba(24, 40, 72, .7)), rgba(24, 40, 72, .7)); /* 鼠标悬停时显示的背景图片 */
url('/config/img/dog.jpg'); /* 鼠标悬停时显示的背景图片 */
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
@@ -150,31 +148,6 @@
border-radius: 10px; border-radius: 10px;
} }
/* 古诗词卡片 */
#card-poem{
display: flex;
flex-direction: column;
padding: 0.5rem!important;
min-height: 130px;
background: linear-gradient(-45deg, rgba(255, 255, 255, .7),
rgba(255, 255, 255, .8),
rgba(255, 255, 255, .8),
rgba(255, 255, 255, .7))!important;
backdrop-filter: blur(10px);
}
[data-theme=dark] #card-poem{
display: flex;
flex-direction: column;
padding: 0.5rem!important;
min-height: 130px;
background: linear-gradient(-45deg, rgba(24, 40, 72, .7),
rgba(35, 37, 58, .8),
rgba(35, 37, 58, .8),
rgba(24, 40, 72, .7))!important;
backdrop-filter: blur(10px);
}
/*文章页面*/ /*文章页面*/
.layout>#post { .layout>#post {
background: linear-gradient(-45deg, rgba(255, 255, 255, .7), background: linear-gradient(-45deg, rgba(255, 255, 255, .7),