|
|
@@ -9,6 +9,7 @@ import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
|
import Shufa from '../Shufa'
|
|
|
import { forwardRef, useImperativeHandle } from 'react'
|
|
|
+import FlipContainer from '@/components/FlipContainner'
|
|
|
|
|
|
type Props = {
|
|
|
setIsShowTabBar: (isShowTabBar: boolean) => void
|
|
|
@@ -20,6 +21,7 @@ type Props = {
|
|
|
function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, ref: any) {
|
|
|
const { myData, myLangue } = useSelector((state: RootState) => state.A0Layout)
|
|
|
|
|
|
+ const [isFlipped, setIsFlipped] = useState(false)
|
|
|
const [selectedTab, setSelectedTab] = useState(0)
|
|
|
const [isOpenTrans, setIsOpenTrans] = useState(false)
|
|
|
const [isShowShufa, setIsShowShufa] = useState(false)
|
|
|
@@ -85,8 +87,7 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
// tooltip.style.setProperty('inset', inset, 'important');
|
|
|
tooltip.style.inset = inset + '!important'
|
|
|
}
|
|
|
- }, 100);
|
|
|
-
|
|
|
+ }, 100)
|
|
|
}, [index, inset])
|
|
|
|
|
|
return (
|
|
|
@@ -225,10 +226,6 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
[setBottomTxt, setIsShowMzmTitle]
|
|
|
)
|
|
|
|
|
|
- // 原文 | 译文 的背景
|
|
|
- useEffect(() => {
|
|
|
- callIframeFu('setStepBgActive', isOpenTrans ? 1 : 0)
|
|
|
- }, [isOpenTrans])
|
|
|
|
|
|
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.'
|
|
|
@@ -242,24 +239,48 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
id='modalTxt'
|
|
|
>
|
|
|
<div className='modalTxtContainner'>
|
|
|
+ {/* <FlipContainer
|
|
|
+ style={{ position: 'absolute', right: '50px', top: '50%', transform: 'translateY(-50%)' }}
|
|
|
+ isFlipped={isFlipped}
|
|
|
+ onClick={() => setIsFlipped(!isFlipped)}
|
|
|
+ frontContent={
|
|
|
+ <div
|
|
|
+ className='aaaa'
|
|
|
+ onClick={() => setIsFlipped(true)}
|
|
|
+ style={{ width: '300px', height: '300px', background: '#ccc' }}
|
|
|
+ ></div>
|
|
|
+ }
|
|
|
+ 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>
|
|
|
|
|
|
-
|
|
|
- {!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 className='intro_btn' onClick={() => setIsOpenTrans(true)}>
|
|
|
+ 原文 | 译文
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div className="intro_txt"> {selectedTab !== 0 && myData.readDetail[selectedTab - 1].intro}</div>
|
|
|
-
|
|
|
- <div className="intro_btn" onClick={() => setIsOpenTrans(true)}>原文 | 译文</div>
|
|
|
- </div>}
|
|
|
+ )}
|
|
|
|
|
|
{selectedTab === 0 && (
|
|
|
<div className='content'>
|
|
|
@@ -270,7 +291,9 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
className='text'
|
|
|
dangerouslySetInnerHTML={{ __html: myLangue === 'EN' ? gaiShuEn : gaiShu }}
|
|
|
></div>
|
|
|
- <div className="shufaBtn" onClick={() => setIsShowShufa(true)}>书法赏析</div>
|
|
|
+ <div className='shufaBtn' onClick={() => setIsShowShufa(true)}>
|
|
|
+ 书法赏析
|
|
|
+ </div>
|
|
|
</div>
|
|
|
)}
|
|
|
|
|
|
@@ -306,12 +329,17 @@ function ModalTxt({ setIsShowTabBar, setIsShowMzmTitle, setBottomTxt }: Props, r
|
|
|
))}
|
|
|
</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>}
|
|
|
+ {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>
|
|
|
{/* 书法赏析 */}
|