This commit is contained in:
Jerry
2024-10-03 17:21:50 +08:00
Unverified
parent d8a1fa6417
commit 2ca779a6ad
7 changed files with 38 additions and 39 deletions
+5
View File
@@ -44,6 +44,11 @@ if hexo-config('waline.bg')
&:focus
background-image: none
.twikoo
.tk-content
p
margin: 3px 0
.fireworks
position: fixed
top: 0
+10 -10
View File
@@ -341,6 +341,7 @@ document.addEventListener('DOMContentLoaded', () => {
}
const addJustifiedGallery = async (ele, tabs = false) => {
if (!ele.length) return
const init = async () => {
for (const item of ele) {
if (btf.isHidden(item) || item.classList.contains('loaded')) continue
@@ -359,8 +360,6 @@ document.addEventListener('DOMContentLoaded', () => {
}
}
if (!ele.length) return
if (typeof InfiniteGrid === 'function') {
init()
} else {
@@ -584,19 +583,19 @@ document.addEventListener('DOMContentLoaded', () => {
const rightSideFn = {
readmode: () => { // read mode
const $body = document.body
$body.classList.add('read-mode')
const newEle = document.createElement('button')
newEle.type = 'button'
newEle.className = 'fas fa-sign-out-alt exit-readmode'
$body.appendChild(newEle)
const clickFn = () => {
const exitReadMode = () => {
$body.classList.remove('read-mode')
newEle.remove()
newEle.removeEventListener('click', clickFn)
newEle.removeEventListener('click', exitReadMode)
}
newEle.addEventListener('click', clickFn)
$body.classList.add('read-mode')
newEle.type = 'button'
newEle.className = 'fas fa-sign-out-alt exit-readmode'
newEle.addEventListener('click', exitReadMode)
$body.appendChild(newEle)
},
darkmode: () => { // switch between light and dark mode
const willChangeMode = document.documentElement.getAttribute('data-theme') === 'dark' ? 'light' : 'dark'
@@ -812,8 +811,9 @@ document.addEventListener('DOMContentLoaded', () => {
if (!switchBtn) return
let switchDone = false
const postComment = document.getElementById('post-comment')
const handleSwitchBtn = () => {
document.getElementById('post-comment').classList.toggle('move')
postComment.classList.toggle('move')
if (!switchDone && typeof loadOtherComment === 'function') {
switchDone = true
loadOtherComment()
+1 -3
View File
@@ -49,9 +49,7 @@
overflowPaddingR: {
add: () => {
const innerWidth = window.innerWidth
const clientWidth = document.body.clientWidth
const paddingRight = innerWidth - clientWidth
const paddingRight = window.innerWidth - document.body.clientWidth
if (paddingRight > 0) {
document.body.style.paddingRight = `${paddingRight}px`