feat: toc 間隔調整, 直接子元素增加豎線辨識 closed #723

fix: 修復 toc 在小設備上顯示出屏幕外的 bug
fix: 修復在打賞按鈕周圍也會觸發打賞彈窗的 bug
fix: Waline 最近評論的時間只顯示 "剛剛" 的問題 (以docker的方式執行) #730
fix: 修復點擊右下角顯示按鈕時,按鈕沒有出現的 bug
remove: 移除 button 的 hover 效果
This commit is contained in:
Jerry
2021-12-22 22:39:27 +08:00
Unverified
parent 36d85c4c23
commit 850c825fcf
17 changed files with 98 additions and 88 deletions

View File

@@ -296,7 +296,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
$header.classList.add('nav-fixed')
if (window.getComputedStyle($rightside).getPropertyValue('opacity') === '0') {
$rightside.style.cssText = 'opacity: 0.7; transform: translateX(-58px)'
$rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)'
}
} else {
if (currentTop === 0) {
@@ -306,7 +306,7 @@ document.addEventListener('DOMContentLoaded', function () {
}
if (document.body.scrollHeight <= innerHeight) {
$rightside.style.cssText = 'opacity: 0.7; transform: translateX(-58px)'
$rightside.style.cssText = 'opacity: 0.8; transform: translateX(-58px)'
}
}, 200)()
}
@@ -478,15 +478,16 @@ document.addEventListener('DOMContentLoaded', function () {
window.DISQUS && document.getElementById('disqus_thread').children.length && setTimeout(() => window.disqusReset(), 200)
typeof runMermaid === 'function' && window.runMermaid()
},
showOrHideBtn: () => { // rightside 點擊設置 按鈕 展開
const target = document.getElementById('rightside-config-hide')
if (window.rightSideIn) {
window.rightSideIn = false
btf.animateOut(target, 'rightside-item-out 0.5s')
} else {
window.rightSideIn = true
btf.animateIn(target, 'rightside-item-in 0.5s')
showOrHideBtn: (e) => { // rightside 點擊設置 按鈕 展開
const rightsideHideClassList = document.getElementById('rightside-config-hide').classList
rightsideHideClassList.toggle('show')
if (e.classList.contains('show')) {
rightsideHideClassList.add('status')
setTimeout(() => {
rightsideHideClassList.remove('status')
}, 300)
}
e.classList.toggle('show')
},
scrollToTop: () => { // Back to top
btf.scrollToDest(0, 500)
@@ -506,13 +507,13 @@ document.addEventListener('DOMContentLoaded', function () {
}
document.getElementById('rightside').addEventListener('click', function (e) {
const $target = e.target.id || e.target.parentNode.id
switch ($target) {
const $target = e.target.id ? e.target : e.target.parentNode
switch ($target.id) {
case 'go-up':
rightSideFn.scrollToTop()
break
case 'rightside_config':
rightSideFn.showOrHideBtn()
rightSideFn.showOrHideBtn($target)
break
case 'mobile-toc-button':
rightSideFn.runMobileToc()
@@ -534,7 +535,6 @@ document.addEventListener('DOMContentLoaded', function () {
/**
* menu
* 側邊欄sub-menu 展開/收縮
* 解決menus在觸摸屏下滑動屏幕menus_item_child不消失的問題手機hover的bug)
*/
const clickFnOfSubMenu = () => {
document.querySelectorAll('#sidebar-menus .site-page.group').forEach(function (item) {
@@ -594,7 +594,7 @@ document.addEventListener('DOMContentLoaded', function () {
/**
* table overflow
*/
const addTableWrap = function () {
const addTableWrap = () => {
const $table = document.querySelectorAll('#article-container :not(.highlight) > table, #article-container > table')
if ($table.length) {
$table.forEach(item => {