mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-16 20:30:53 +08:00
feat: 增加 post_pagination 配置(可關閉/配置分頁展示邏輯)
feat: 可配置最新評論的緩存時間 fix: 修復pjax下不會跳轉404頁面的bug fix: 修復手持設備橫向翻轉時,menu 沒有進行判斷,而導致樣式錯亂的bug fix: 修復文字點擊關閉random無效的bug fix: 修復子目錄下,打賞圖片跳轉鏈接會錯誤的bug improvement: 文章版權右上角改為 版權icon improvement: pangu的操作範圍增大到 body-wrap裏的內容 improvement: pug 判斷優化 improvement: 最新評論js優化 remove: 移除 fragment_cache 配置(默認開啟) remove: 移除百度推送(百度已棄用)和百度轉碼
This commit is contained in:
@@ -75,5 +75,5 @@
|
||||
transform: scale(1.1)
|
||||
|
||||
&.pagination-post
|
||||
margin: 2rem 0 !important
|
||||
margin-top: 2rem
|
||||
background: $dark-black
|
||||
@@ -218,24 +218,13 @@ no-beautify()
|
||||
transition: box-shadow .3s ease-in-out
|
||||
|
||||
&:before
|
||||
@extend .fontawesomeIcon
|
||||
position: absolute
|
||||
top: t = .5rem
|
||||
right: t
|
||||
width: w = .8rem
|
||||
height: w
|
||||
border-radius: w
|
||||
background: $light-blue
|
||||
content: ''
|
||||
|
||||
&:after
|
||||
position: absolute
|
||||
top: t = .7rem
|
||||
right: t
|
||||
width: w = .4rem
|
||||
height: w
|
||||
border-radius: w
|
||||
background: var(--card-bg)
|
||||
content: ''
|
||||
top: .1rem
|
||||
right: .6rem
|
||||
color: $theme-color
|
||||
content: '\f1f9'
|
||||
font-size: 1rem
|
||||
|
||||
&:hover
|
||||
box-shadow: 0 0 8px 0 rgba(232, 237, 250, .6), 0 2px 4px 0 rgba(232, 237, 250, .5)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
.relatedPosts
|
||||
margin-top: 1rem
|
||||
margin-top: 2rem
|
||||
|
||||
& > .headline
|
||||
margin-bottom: 5px
|
||||
|
||||
@@ -1,17 +1,16 @@
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
let blogNameWidth = document.getElementById('site-name').offsetWidth
|
||||
const $blogName = document.getElementById('site-name')
|
||||
let blogNameWidth = $blogName && $blogName.offsetWidth
|
||||
const $menusEle = document.querySelector('#menus .menus_items')
|
||||
let menusWidth = $menusEle && $menusEle.offsetWidth
|
||||
const $searchEle = document.querySelector('#search-button')
|
||||
let searchWidth = $searchEle && $searchEle.offsetWidth
|
||||
let detectFontSizeChange = false
|
||||
|
||||
const adjustMenu = () => {
|
||||
if (detectFontSizeChange) {
|
||||
blogNameWidth = document.getElementById('site-name').offsetWidth
|
||||
const adjustMenu = (change = false) => {
|
||||
if (change) {
|
||||
blogNameWidth = $blogName && $blogName.offsetWidth
|
||||
menusWidth = $menusEle && $menusEle.offsetWidth
|
||||
searchWidth = $searchEle && $searchEle.offsetWidth
|
||||
detectFontSizeChange = false
|
||||
}
|
||||
const $nav = document.getElementById('nav')
|
||||
let t
|
||||
@@ -536,17 +535,16 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
adjustFontSize: (plus) => {
|
||||
const fontSizeVal = parseInt(window.getComputedStyle(document.documentElement).getPropertyValue('--global-font-size'))
|
||||
let newValue = ''
|
||||
detectFontSizeChange = true
|
||||
if (plus) {
|
||||
if (fontSizeVal >= 20) return
|
||||
newValue = fontSizeVal + 1
|
||||
document.documentElement.style.setProperty('--global-font-size', newValue + 'px')
|
||||
!document.getElementById('nav').classList.contains('hide-menu') && adjustMenu()
|
||||
!document.getElementById('nav').classList.contains('hide-menu') && adjustMenu(true)
|
||||
} else {
|
||||
if (fontSizeVal <= 10) return
|
||||
newValue = fontSizeVal - 1
|
||||
document.documentElement.style.setProperty('--global-font-size', newValue + 'px')
|
||||
document.getElementById('nav').classList.contains('hide-menu') && adjustMenu()
|
||||
document.getElementById('nav').classList.contains('hide-menu') && adjustMenu(true)
|
||||
}
|
||||
|
||||
saveToLocal.set('global-font-size', newValue, 2)
|
||||
@@ -798,6 +796,7 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
|
||||
const unRefreshFn = function () {
|
||||
window.addEventListener('resize', adjustMenu)
|
||||
window.addEventListener('orientationchange', () => { setTimeout(adjustMenu(true), 100) })
|
||||
|
||||
clickFnOfSubMenu()
|
||||
GLOBAL_CONFIG.islazyload && lazyloadImg()
|
||||
|
||||
Reference in New Issue
Block a user