mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-10-03 22:22:00 +08:00
chore: 升級版本至 5.5.3 並合併開發分支功能更新
主要更新內容: - feat: 網站背景支援隨機數組配置,可從多個背景中隨機選擇 - feat: 增加文章分頁封面配置 pagination_cover 選項 - improvement: 優化代碼高亮工具複製按鈕的位置計算和邊界檢查 - improvement: 優化 Pjax 載入,script 標籤新增 defer 屬性 - improvement: 優化相關文章算法,提升性能並改進排序邏輯 - improvement: 優化側邊欄歸檔和分類模塊的性能 - improvement: 改善 TOC 滾動檢測和位置計算 - improvement: 優化 Umami Analytics 數據處理邏輯 - fix: 修復代碼塊工具欄圖標對齊和樣式問題 - fix: 修復夜間模式下圖片亮度調整 - fix: 修復閱讀模式按鈕樣式和功能 - chore: 更新多個依賴套件版本(algolia, fancybox, katex, mermaid, waline 等) 此次合併解決了所有衝突並整合了開發分支的所有新功能和優化。
This commit is contained in:
commit
1fe36a26c2
24 files changed
+327
-274
No files matched your search
+2
-1
@@ -91,7 +91,8 @@ category_per_img:
|
||||
footer_img: false
|
||||
|
||||
# Website Background
|
||||
# Can set it to color or image url
|
||||
# Can set it to color, image URL or an array containing colors and/or image URLs
|
||||
# If an array is provided, a random background will be selected from the array on each load
|
||||
background:
|
||||
|
||||
cover:
|
||||
|
||||
@@ -52,7 +52,7 @@ div
|
||||
!= partial("includes/third-party/umami_analytics", {}, { cache: true })
|
||||
|
||||
if theme.busuanzi.site_uv || theme.busuanzi.site_pv || theme.busuanzi.page_pv
|
||||
script(async data-pjax src=url_for(theme.asset.busuanzi) || '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||
script(async data-pjax src=theme.asset.busuanzi ? url_for(theme.asset.busuanzi) : '//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js')
|
||||
|
||||
!= partial('includes/third-party/search/index', {}, { cache: true })
|
||||
|
||||
|
||||
@@ -13,7 +13,29 @@ html(lang=config.language data-theme=theme.display_mode class=htmlClassHideAside
|
||||
!=partial('includes/loading/index', {}, {cache: true})
|
||||
|
||||
if theme.background
|
||||
#web_bg(style=getBgPath(theme.background))
|
||||
if !Array.isArray(theme.background)
|
||||
#web_bg.bg-animation(style=getBgPath(theme.background))
|
||||
else
|
||||
#web_bg.bg-animation
|
||||
- const bgStyleArr = theme.background.map(getBgPath)
|
||||
script.
|
||||
(() => {
|
||||
const arr = !{JSON.stringify(bgStyleArr)}
|
||||
const webBgDiv = document.getElementById('web_bg')
|
||||
|
||||
const setRandomBg = () => {
|
||||
webBgDiv.style = arr[Math.floor(Math.random() * arr.length)]
|
||||
requestAnimationFrame(() => webBgDiv.classList.add('bg-animation'))
|
||||
}
|
||||
|
||||
document.addEventListener('pjax:send', () => {
|
||||
webBgDiv.style = ''
|
||||
webBgDiv.classList.remove('bg-animation')
|
||||
})
|
||||
|
||||
document.addEventListener('pjax:complete', setRandomBg)
|
||||
document.addEventListener('DOMContentLoaded', setRandomBg)
|
||||
})()
|
||||
|
||||
!=partial('includes/sidebar', {}, {cache: true})
|
||||
|
||||
|
||||
Loaded 3 of 24 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user