mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
breaking changes: 移除 html 的 font-size 改為瀏覽器默認大小
feat: 為文章單獨設置 TOC simple_style 顯示 closed #631 feat: page 頁頂部圖增加黑色遮罩 closed #671 feat: 首頁 pagination 更新 UI fix: 修復使用本地搜索時,搜索插件配置為不搜索文章內容會無法使用搜索 的 bug fix: 修復開啟 photofigcaption 後,導致inlineImg標籤外掛顯示錯亂的 bug fix: 修復 字體過大/過小而導致 部分 ui 偏移的 bug improvement: 主題 css 使用的 rem 改為 em 或 px improvement: 修改没有顶部图下,文章页的标题大小 closed #669 improvement: 代碼優化
This commit is contained in:
@@ -354,6 +354,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const $cardToc = $cardTocLayout.getElementsByClassName('toc-content')[0]
|
||||
const $tocLink = $cardToc.querySelectorAll('.toc-link')
|
||||
const $article = document.getElementById('article-container')
|
||||
const $tocPercentage = $cardTocLayout.querySelector('.toc-percentage')
|
||||
|
||||
// main of scroll
|
||||
window.tocScrollFn = function () {
|
||||
@@ -373,7 +374,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
const scrollPercent = (currentTop - headerHeight) / (contentMath)
|
||||
const scrollPercentRounded = Math.round(scrollPercent * 100)
|
||||
const percentage = (scrollPercentRounded > 100) ? 100 : (scrollPercentRounded <= 0) ? 0 : scrollPercentRounded
|
||||
$cardToc.setAttribute('progress-percentage', percentage)
|
||||
$tocPercentage.textContent = percentage
|
||||
}
|
||||
|
||||
// anchor
|
||||
|
||||
@@ -47,9 +47,10 @@ window.addEventListener('load', () => {
|
||||
.then(str => new window.DOMParser().parseFromString(str, 'text/xml'))
|
||||
.then(data => {
|
||||
const datas = [...data.querySelectorAll('entry')].map(function (item) {
|
||||
const content = item.querySelector('content')
|
||||
return {
|
||||
title: item.querySelector('title').textContent,
|
||||
content: item.querySelector('content').textContent,
|
||||
content: content ? content.textContent : '',
|
||||
url: item.querySelector('url').textContent
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user