File tree 3 files changed +12
-11
lines changed
themes/magzine/components
3 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -79,13 +79,14 @@ const OpenWrite = () => {
79
79
return
80
80
}
81
81
if ( isBrowser && blogId ) {
82
+ toggleTocItems ( true ) // 禁止目录项的点击
83
+
82
84
// Check if the element with id 'read-more-wrap' already exists
83
85
const readMoreWrap = document . getElementById ( 'read-more-wrap' )
84
86
85
87
// Only load the script if the element doesn't exist
86
88
if ( ! readMoreWrap ) {
87
89
loadOpenWrite ( )
88
- toggleTocItems ( true ) // 禁止目录项的点击
89
90
}
90
91
}
91
92
} )
Original file line number Diff line number Diff line change @@ -70,22 +70,22 @@ const Catalog = ({ toc, className }) => {
70
70
< div
71
71
className = 'overflow-y-auto scroll-hidden lg:max-h-dvh max-h-44'
72
72
ref = { tRef } >
73
- < nav className = 'h-full text-black' >
73
+ < nav className = 'h-full text-black' >
74
74
{ toc . map ( tocItem => {
75
75
const id = uuidToId ( tocItem . id )
76
76
tocIds . push ( id )
77
77
return (
78
78
< a
79
79
key = { id }
80
80
href = { `#${ id } ` }
81
- className = { `notion-table-of-contents-item duration-300 transform dark:text-gray-300
81
+ className = { `notion-table-of-contents-item duration-300 transform dark:text-gray-400
82
82
notion-table-of-contents-item-indent-level-${ tocItem . indentLevel } ` } >
83
83
< span
84
84
style = { {
85
85
display : 'inline-block' ,
86
86
marginLeft : tocItem . indentLevel * 16
87
87
} }
88
- className = { `truncate ${ activeSection === id ? 'font-bold text-gray-500 underline' : '' } ` } >
88
+ className = { `truncate ${ activeSection === id ? 'font-bold text-gray-500 dark:text-white underline' : '' } ` } >
89
89
{ tocItem . text }
90
90
</ span >
91
91
</ a >
Original file line number Diff line number Diff line change 1
- import { useEffect , useState } from 'react'
2
1
import { isBrowser } from '@/lib/utils'
2
+ import { useEffect , useState } from 'react'
3
3
4
4
/**
5
5
* 顶部页面阅读进度条
@@ -10,7 +10,8 @@ const Progress = ({ targetRef, showPercent = true }) => {
10
10
const currentRef = targetRef ?. current || targetRef
11
11
const [ percent , changePercent ] = useState ( 0 )
12
12
const scrollListener = ( ) => {
13
- const target = currentRef || ( isBrowser && document . getElementById ( 'article-wrapper' ) )
13
+ const target =
14
+ currentRef || ( isBrowser && document . getElementById ( 'article-wrapper' ) )
14
15
if ( target ) {
15
16
const clientHeight = target . clientHeight
16
17
const scrollY = window . pageYOffset
@@ -28,13 +29,12 @@ const Progress = ({ targetRef, showPercent = true }) => {
28
29
} , [ ] )
29
30
30
31
return (
31
- < div className = " h-4 w-full shadow-2xl bg-hexo-light-gray dark:bg-black" >
32
+ < div className = ' h-4 w-full shadow-2xl bg-hexo-light-gray dark:bg-black' >
32
33
< div
33
- className = "h-4 bg-gray-600 duration-200"
34
- style = { { width : `${ percent } %` } }
35
- >
34
+ className = 'h-4 bg-gray-600 dark:bg-hexo-black-gray duration-200'
35
+ style = { { width : `${ percent } %` } } >
36
36
{ showPercent && (
37
- < div className = " text-right text-white text-xs" > { percent } %</ div >
37
+ < div className = ' text-right text-white text-xs' > { percent } %</ div >
38
38
) }
39
39
</ div >
40
40
</ div >
You can’t perform that action at this time.
0 commit comments