|
@@ -3,16 +3,14 @@ import styles from './index.module.scss'
|
|
|
import { useSelector } from 'react-redux'
|
|
import { useSelector } from 'react-redux'
|
|
|
import { RootState } from '@/store'
|
|
import { RootState } from '@/store'
|
|
|
import iosTouch from '@/utils/iosTouch'
|
|
import iosTouch from '@/utils/iosTouch'
|
|
|
|
|
+import Bwzzq from './components/Bwzzq'
|
|
|
|
|
+import Bwzwq from './components/Bwzwq'
|
|
|
|
|
+import Bwwq from './components/Bwwq'
|
|
|
|
|
+import Bq from './components/Bq'
|
|
|
|
|
+import Bz from './components/Bz'
|
|
|
|
|
|
|
|
-type InfoCardProps = {
|
|
|
|
|
- time: string
|
|
|
|
|
- location: string
|
|
|
|
|
- text?: string
|
|
|
|
|
- from: string
|
|
|
|
|
- inset?: string
|
|
|
|
|
- index: number
|
|
|
|
|
-}
|
|
|
|
|
-type showLineType = {
|
|
|
|
|
|
|
+
|
|
|
|
|
+export type showLineType = {
|
|
|
index: number
|
|
index: number
|
|
|
isShow: boolean
|
|
isShow: boolean
|
|
|
}[]
|
|
}[]
|
|
@@ -74,6 +72,7 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
setSelectedTime(index)
|
|
setSelectedTime(index)
|
|
|
|
|
+ console.log(selectedTime, 'selectedTime')
|
|
|
setIsShowLine(
|
|
setIsShowLine(
|
|
|
myData.sinicizeData[index].imgItems.map((item, index) => ({
|
|
myData.sinicizeData[index].imgItems.map((item, index) => ({
|
|
|
index,
|
|
index,
|
|
@@ -113,66 +112,14 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
// ori_touchStartX.current = e.touches[0].clientY
|
|
// ori_touchStartX.current = e.touches[0].clientY
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- const InfoCard = ({ time, location, text, from, inset, index }: InfoCardProps) => {
|
|
|
|
|
- return (
|
|
|
|
|
- <div className={styles.InfoCard} style={{ inset: inset }}>
|
|
|
|
|
- <div
|
|
|
|
|
- className='cardClose'
|
|
|
|
|
- onClick={() =>
|
|
|
|
|
- setIsShowLine(
|
|
|
|
|
- isShowLine.map(item => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- isShow: item.index === index + 1 ? true : item.isShow
|
|
|
|
|
- }))
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
- >
|
|
|
|
|
- ×
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className='dotLeft'>
|
|
|
|
|
- <img src={require('@/assets/img/A6_arrow.png')} alt='' />
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className='main'>
|
|
|
|
|
- <div className='time'>{time}</div>
|
|
|
|
|
- <div className='location'>{location}</div>
|
|
|
|
|
- <div className='Cardtext'>{text}</div>
|
|
|
|
|
- <div className='from'>{from}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- const InfoPoint = ({ time, title, width = 150, direction = 'right', dx = 50, dy = 50 }: { time: string; title: string; width?: number; direction?: string; dx?: number; dy?: number }) => {
|
|
|
|
|
- return (<div
|
|
|
|
|
- className={`point point${direction}`}
|
|
|
|
|
- style={{ transform: `translate(${dx}%, ${dy}%)` }}
|
|
|
|
|
- onClick={() =>
|
|
|
|
|
- setIsShowLine(
|
|
|
|
|
- isShowLine.map(item => ({
|
|
|
|
|
- ...item,
|
|
|
|
|
- isShow: item.index === 0 ? false : item.isShow
|
|
|
|
|
- }))
|
|
|
|
|
- )
|
|
|
|
|
- }
|
|
|
|
|
- >
|
|
|
|
|
- <img src={require('@/assets/img/A6_pointBg.png')} alt="" />
|
|
|
|
|
- <div className="pPoint" style={{ width: width + 'px' }}>
|
|
|
|
|
-
|
|
|
|
|
- <div className='pointTime songFont'>{time}</div>
|
|
|
|
|
- <div className='pointTitle songFont'>{title}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- </div>)
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<div
|
|
<div
|
|
|
id='A7Sinicize'
|
|
id='A7Sinicize'
|
|
|
className={styles.Sinicize}
|
|
className={styles.Sinicize}
|
|
|
onWheel={handleWheel}
|
|
onWheel={handleWheel}
|
|
|
- // onTouchMove={handleOriTouchMove}
|
|
|
|
|
- // onTouchStart={handleTouchStart}
|
|
|
|
|
|
|
+ // onTouchMove={handleOriTouchMove}
|
|
|
|
|
+ // onTouchStart={handleTouchStart}
|
|
|
>
|
|
>
|
|
|
<div className='SinicizeScroll' ref={originRef}>
|
|
<div className='SinicizeScroll' ref={originRef}>
|
|
|
<div ref={sinicize1Ref} className={styles.Sinicize1}>
|
|
<div ref={sinicize1Ref} className={styles.Sinicize1}>
|
|
@@ -246,106 +193,112 @@ function Sinicize({ setGotopage }: { setGotopage: (page: number) => void }) {
|
|
|
|
|
|
|
|
<div className={styles.Sinicize2}>
|
|
<div className={styles.Sinicize2}>
|
|
|
<div className='scroll'>
|
|
<div className='scroll'>
|
|
|
- {myData.sinicizeData.map((sItem, index) => (
|
|
|
|
|
- <div className='yearItem' key={index}>
|
|
|
|
|
- <div
|
|
|
|
|
- className='year'
|
|
|
|
|
- style={{ backgroundImage: `url(${sItem.bgPath})` }}
|
|
|
|
|
- onClick={() => handleYearItemClick(index)}
|
|
|
|
|
- >
|
|
|
|
|
- <div className='yearContainner'>
|
|
|
|
|
- <div className='txt songFont'>{sItem.time}</div>
|
|
|
|
|
- {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ {/* 北魏早中期 */}
|
|
|
|
|
+ <div className='yearItem' key={0}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='year'
|
|
|
|
|
+ style={{ backgroundImage: `url(${myData.sinicizeData[0].bgPath})` }}
|
|
|
|
|
+ onClick={() => handleYearItemClick(0)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner'>
|
|
|
|
|
+ <div className='txt songFont'>{myData.sinicizeData[0].time}</div>
|
|
|
|
|
+ {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Bwzzq
|
|
|
|
|
+ sItem={myData.sinicizeData[0]}
|
|
|
|
|
+ index={0}
|
|
|
|
|
+ selectedTime={selectedTime}
|
|
|
|
|
+ isShowLine={isShowLine}
|
|
|
|
|
+ setIsShowLine={setIsShowLine}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- <div
|
|
|
|
|
- id='sinicizeDetail'
|
|
|
|
|
- className={`${selectedTime === index ? 'detailShow' : 'detailHide'}`}
|
|
|
|
|
- >
|
|
|
|
|
- {/* {selectedTime === index && ( */}
|
|
|
|
|
- <>
|
|
|
|
|
- <div className='left'>
|
|
|
|
|
- <div className='lTop'>{sItem.desc}</div>
|
|
|
|
|
- <div className='lContent'>
|
|
|
|
|
- <div className='lInfo'>
|
|
|
|
|
- <div className='item' key={index}>
|
|
|
|
|
- <div className='lTitle songFont'>{sItem.items[0].title}</div>
|
|
|
|
|
- <div className='lText'>{sItem.items[0].txt}</div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className='lImgBox'>
|
|
|
|
|
- {/* <img
|
|
|
|
|
- src={isShowLine ? sItem.imgItems[0].srcLine : sItem.imgItems[0].src}
|
|
|
|
|
- alt=''
|
|
|
|
|
- /> */}
|
|
|
|
|
- <div
|
|
|
|
|
- style={{
|
|
|
|
|
- backgroundImage: `url(${
|
|
|
|
|
- isShowLine[0]?.isShow
|
|
|
|
|
- ? sItem.imgItems[0].srcLine
|
|
|
|
|
- : sItem.imgItems[0].src
|
|
|
|
|
- })`
|
|
|
|
|
- }}
|
|
|
|
|
- className={`pic ${isShowLine[0]?.isShow ? 'picLine' : ''}`}
|
|
|
|
|
- />
|
|
|
|
|
- {!isShowLine[0]?.isShow ? (
|
|
|
|
|
- <InfoCard
|
|
|
|
|
- time={sItem.imgItems[0].time}
|
|
|
|
|
- location={sItem.imgItems[0].title}
|
|
|
|
|
- text={sItem.imgItems[0].txt}
|
|
|
|
|
- from={sItem.imgItems[0].title}
|
|
|
|
|
- index={0}
|
|
|
|
|
- />
|
|
|
|
|
- ) : (
|
|
|
|
|
- InfoPoint({
|
|
|
|
|
- time: sItem.imgItems[0].time,
|
|
|
|
|
- title: sItem.imgItems[0].title
|
|
|
|
|
- })
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ {/* 北魏早晚期 */}
|
|
|
|
|
+ <div className='yearItem' key={1}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='year'
|
|
|
|
|
+ style={{ backgroundImage: `url(${myData.sinicizeData[1].bgPath})` }}
|
|
|
|
|
+ onClick={() => handleYearItemClick(1)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner'>
|
|
|
|
|
+ <div className='txt songFont'>{myData.sinicizeData[1].time}</div>
|
|
|
|
|
+ {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Bwzwq
|
|
|
|
|
+ sItem={myData.sinicizeData[1]}
|
|
|
|
|
+ index={1}
|
|
|
|
|
+ selectedTime={selectedTime}
|
|
|
|
|
+ isShowLine={isShowLine}
|
|
|
|
|
+ setIsShowLine={setIsShowLine}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div className='right'>
|
|
|
|
|
- <div className='RItems'>
|
|
|
|
|
- {sItem.imgItems
|
|
|
|
|
- .filter((i, index) => index !== 0)
|
|
|
|
|
- .map((i, index2) => (
|
|
|
|
|
- <div className='item' key={index2}>
|
|
|
|
|
- {/* <div className='pic'>
|
|
|
|
|
- <img src={i.src} alt='' />
|
|
|
|
|
- </div> */}
|
|
|
|
|
- <div
|
|
|
|
|
- style={{
|
|
|
|
|
- backgroundImage: `url(${
|
|
|
|
|
- isShowLine[index2 + 1]?.isShow ? i.srcLine : i.src
|
|
|
|
|
- })`
|
|
|
|
|
- }}
|
|
|
|
|
- className={`pic ${
|
|
|
|
|
- isShowLine[index2 + 1]?.isShow ? 'picLine' : ''
|
|
|
|
|
- }`}
|
|
|
|
|
- />
|
|
|
|
|
- {!isShowLine[index2 + 1]?.isShow ? (
|
|
|
|
|
- <InfoCard
|
|
|
|
|
- time={i.time}
|
|
|
|
|
- location={i.title}
|
|
|
|
|
- text={i.txt}
|
|
|
|
|
- from={i.title}
|
|
|
|
|
- index={index2}
|
|
|
|
|
- />
|
|
|
|
|
- ) : (
|
|
|
|
|
- < InfoPoint time={i.time} title={i.title} />
|
|
|
|
|
- )}
|
|
|
|
|
- </div>
|
|
|
|
|
- ))}
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </>
|
|
|
|
|
- {/* )} */}
|
|
|
|
|
|
|
+ {/* 北魏晚期 */}
|
|
|
|
|
+ <div className='yearItem' key={2}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='year'
|
|
|
|
|
+ style={{ backgroundImage: `url(${myData.sinicizeData[2].bgPath})` }}
|
|
|
|
|
+ onClick={() => handleYearItemClick(2)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner'>
|
|
|
|
|
+ <div className='txt songFont'>{myData.sinicizeData[2].time}</div>
|
|
|
|
|
+ {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- ))}
|
|
|
|
|
|
|
+ <Bwwq
|
|
|
|
|
+ sItem={myData.sinicizeData[2]}
|
|
|
|
|
+ index={2}
|
|
|
|
|
+ selectedTime={selectedTime}
|
|
|
|
|
+ isShowLine={isShowLine}
|
|
|
|
|
+ setIsShowLine={setIsShowLine}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 北齐 */}
|
|
|
|
|
+ <div className='yearItem' key={3}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='year'
|
|
|
|
|
+ style={{ backgroundImage: `url(${myData.sinicizeData[3].bgPath})` }}
|
|
|
|
|
+ onClick={() => handleYearItemClick(3)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner'>
|
|
|
|
|
+ <div className='txt songFont'>{myData.sinicizeData[3].time}</div>
|
|
|
|
|
+ {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Bq
|
|
|
|
|
+ sItem={myData.sinicizeData[3]}
|
|
|
|
|
+ index={3}
|
|
|
|
|
+ selectedTime={selectedTime}
|
|
|
|
|
+ isShowLine={isShowLine}
|
|
|
|
|
+ setIsShowLine={setIsShowLine}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 北周 */}
|
|
|
|
|
+ <div className='yearItem' key={4}>
|
|
|
|
|
+ <div
|
|
|
|
|
+ className='year'
|
|
|
|
|
+ style={{ backgroundImage: `url(${myData.sinicizeData[4].bgPath})` }}
|
|
|
|
|
+ onClick={() => handleYearItemClick(4)}
|
|
|
|
|
+ >
|
|
|
|
|
+ <div className='yearContainner'>
|
|
|
|
|
+ <div className='txt songFont'>{myData.sinicizeData[4].time}</div>
|
|
|
|
|
+ {/* <div className='front'>{sItem.desc}</div> */}
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <Bz
|
|
|
|
|
+ sItem={myData.sinicizeData[4]}
|
|
|
|
|
+ index={4}
|
|
|
|
|
+ selectedTime={selectedTime}
|
|
|
|
|
+ isShowLine={isShowLine}
|
|
|
|
|
+ setIsShowLine={setIsShowLine}
|
|
|
|
|
+ />
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ {/* 结语 */}
|
|
|
<div className='yearItem'>
|
|
<div className='yearItem'>
|
|
|
<div className='year year-zongjie'>
|
|
<div className='year year-zongjie'>
|
|
|
<div className='yearContainner'>
|
|
<div className='yearContainner'>
|