|
@@ -23,7 +23,6 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
|
|
|
|
|
const [isFlipped, setIsFlipped] = useState(false)
|
|
const [isFlipped, setIsFlipped] = useState(false)
|
|
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
|
- const [isOpenTrans, setIsOpenTrans] = useState(false)
|
|
|
|
|
const [isShowShufa, setIsShowShufa] = useState(false)
|
|
const [isShowShufa, setIsShowShufa] = useState(false)
|
|
|
const selectedTabRef = useRef(0)
|
|
const selectedTabRef = useRef(0)
|
|
|
|
|
|
|
@@ -56,7 +55,10 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
}, [selectedTab, setIsShowMzmTitle, setIsShowTabBar])
|
|
}, [selectedTab, setIsShowMzmTitle, setIsShowTabBar])
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
|
- if (selectedTab === 0) setIsOpenTrans(false)
|
|
|
|
|
|
|
+ if (selectedTab === 0) {
|
|
|
|
|
+ setIsFlipped(false)
|
|
|
|
|
+ }
|
|
|
|
|
+ setShowTooltip(-1)
|
|
|
localStorage.setItem('selectedBeiwen', selectedTab.toString())
|
|
localStorage.setItem('selectedBeiwen', selectedTab.toString())
|
|
|
}, [selectedTab])
|
|
}, [selectedTab])
|
|
|
|
|
|
|
@@ -130,12 +132,17 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
onTouchStart={() => (dragFlag.current = false)} // 触摸开始时重置标志位
|
|
onTouchStart={() => (dragFlag.current = false)} // 触摸开始时重置标志位
|
|
|
onTouchMove={() => (dragFlag.current = true)} // 检测到移动时标记为拖拽
|
|
onTouchMove={() => (dragFlag.current = true)} // 检测到移动时标记为拖拽
|
|
|
onTouchEnd={e => {
|
|
onTouchEnd={e => {
|
|
|
|
|
+ e.preventDefault()
|
|
|
|
|
+ e.stopPropagation()
|
|
|
if (!dragFlag.current) {
|
|
if (!dragFlag.current) {
|
|
|
- // 只有非拖拽操作才处理
|
|
|
|
|
handleClick()
|
|
handleClick()
|
|
|
}
|
|
}
|
|
|
}}
|
|
}}
|
|
|
- onClick={handleClick}
|
|
|
|
|
|
|
+ onClick={(e: React.MouseEvent) => {
|
|
|
|
|
+ e.preventDefault()
|
|
|
|
|
+ e.stopPropagation()
|
|
|
|
|
+ handleClick()
|
|
|
|
|
+ }}
|
|
|
>
|
|
>
|
|
|
{word}
|
|
{word}
|
|
|
</a>
|
|
</a>
|
|
@@ -226,7 +233,6 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
[setBottomTxt, setIsShowMzmTitle]
|
|
[setBottomTxt, setIsShowMzmTitle]
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const gaiShuEn =
|
|
const gaiShuEn =
|
|
|
'The inscription on the Cheng Zhe Stele consists of 31 lines of regular script,<br/>with 45 characters per line at maximum.<br/>The characters are approximately 2 cm in size, set within square grids, totaling 1,404 characters.<br/>No formal title of the stele is engraved. <br/>The entire text praises the historical achievements of the Cheng family.'
|
|
'The inscription on the Cheng Zhe Stele consists of 31 lines of regular script,<br/>with 45 characters per line at maximum.<br/>The characters are approximately 2 cm in size, set within square grids, totaling 1,404 characters.<br/>No formal title of the stele is engraved. <br/>The entire text praises the historical achievements of the Cheng family.'
|
|
|
const gaiShu =
|
|
const gaiShu =
|
|
@@ -239,48 +245,52 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
id='modalTxt'
|
|
id='modalTxt'
|
|
|
>
|
|
>
|
|
|
<div className='modalTxtContainner'>
|
|
<div className='modalTxtContainner'>
|
|
|
- {/* <FlipContainer
|
|
|
|
|
- style={{ position: 'absolute', right: '50px', top: '50%', transform: 'translateY(-50%)' }}
|
|
|
|
|
|
|
+ {selectedTab !== 0 && <FlipContainer
|
|
|
|
|
+ style={{
|
|
|
|
|
+ width: '82%',
|
|
|
|
|
+ height: '100%'
|
|
|
|
|
+ }}
|
|
|
isFlipped={isFlipped}
|
|
isFlipped={isFlipped}
|
|
|
- onClick={() => setIsFlipped(!isFlipped)}
|
|
|
|
|
frontContent={
|
|
frontContent={
|
|
|
<div
|
|
<div
|
|
|
- className='aaaa'
|
|
|
|
|
- onClick={() => setIsFlipped(true)}
|
|
|
|
|
- style={{ width: '300px', height: '300px', background: '#ccc' }}
|
|
|
|
|
- ></div>
|
|
|
|
|
|
|
+ className='intro'
|
|
|
|
|
+ id='introContent'
|
|
|
|
|
+ >
|
|
|
|
|
+ {(
|
|
|
|
|
+ <>
|
|
|
|
|
+ <div className='intro_title songFont'>
|
|
|
|
|
+ {modalTxtTab[selectedTab - 1].name}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div className='intro_txt'>
|
|
|
|
|
+ {myData.readDetail[selectedTab - 1].intro}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='intro_btn'
|
|
|
|
|
+ onClick={() => {
|
|
|
|
|
+ setIsFlipped(true)
|
|
|
|
|
+ }}
|
|
|
|
|
+ >
|
|
|
|
|
+ {/* 原文<span className='intro_btn_dot'></span>译文
|
|
|
|
|
+ <span className='intro_btn_dot'></span> */}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </>
|
|
|
|
|
+ )}
|
|
|
|
|
+ </div>
|
|
|
}
|
|
}
|
|
|
backContent={
|
|
backContent={
|
|
|
- <div
|
|
|
|
|
- className='aaaa'
|
|
|
|
|
- onClick={() => setIsFlipped(false)}
|
|
|
|
|
- style={{ width: '300px', height: '300px', background: '#6d1e1eff' }}
|
|
|
|
|
- ></div>
|
|
|
|
|
- }
|
|
|
|
|
- /> */}
|
|
|
|
|
-
|
|
|
|
|
- {!isOpenTrans && (
|
|
|
|
|
- <div
|
|
|
|
|
- className='intro'
|
|
|
|
|
- id='introContent'
|
|
|
|
|
- style={{
|
|
|
|
|
- opacity: selectedTab !== 0 ? '1' : '0',
|
|
|
|
|
- height: selectedTab !== 0 ? '78%' : '0%',
|
|
|
|
|
- width: selectedTab !== 0 ? '100%' : '0%'
|
|
|
|
|
- }}
|
|
|
|
|
- >
|
|
|
|
|
- <div className='intro_title songFont'>
|
|
|
|
|
- {selectedTab !== 0 && modalTxtTab[selectedTab - 1].name}
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className='intro_txt'>
|
|
|
|
|
- {selectedTab !== 0 && myData.readDetail[selectedTab - 1].intro}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
|
|
|
- <div className='intro_btn' onClick={() => setIsOpenTrans(true)}>
|
|
|
|
|
- 原文 | 译文
|
|
|
|
|
|
|
+ <div className='translateModal'>
|
|
|
|
|
+ {(
|
|
|
|
|
+ <div className='txtWithTrans' onClick={() => setIsFlipped(false)} onTouchMove={() => setShowTooltip(-1)}>
|
|
|
|
|
+ {CommentText({
|
|
|
|
|
+ str: myData.readDetail[selectedTab - 1].translate_v2,
|
|
|
|
|
+ index: selectedTab - 1
|
|
|
|
|
+ })}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ )}
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ />}
|
|
|
|
|
|
|
|
{selectedTab === 0 && (
|
|
{selectedTab === 0 && (
|
|
|
<div className='content'>
|
|
<div className='content'>
|
|
@@ -328,18 +338,6 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
</div>
|
|
</div>
|
|
|
))}
|
|
))}
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- {isOpenTrans && selectedTab !== 0 && (
|
|
|
|
|
- <div className='translateModal'>
|
|
|
|
|
- <div className='txtWithTrans' onTouchMove={() => setShowTooltip(-1)}>
|
|
|
|
|
- {' '}
|
|
|
|
|
- {CommentText({
|
|
|
|
|
- str: myData.readDetail[selectedTab - 1].translate_v2,
|
|
|
|
|
- index: selectedTab - 1
|
|
|
|
|
- })}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- )}
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
{/* 书法赏析 */}
|
|
{/* 书法赏析 */}
|