2017-07-17 21:11:58 +08:00
|
|
|
import React from 'react'
|
|
|
|
import PropTypes from 'prop-types'
|
2017-07-25 15:35:23 +08:00
|
|
|
import { Col, Icon } from 'antd'
|
2017-07-17 21:11:58 +08:00
|
|
|
import "./Intro.scss"
|
2017-07-25 15:35:23 +08:00
|
|
|
import { OverPack } from 'rc-scroll-anim'
|
|
|
|
import TweenOne from 'rc-tween-one'
|
|
|
|
import QueueAnim from 'rc-queue-anim';
|
2017-07-17 21:11:58 +08:00
|
|
|
|
|
|
|
const IntroPart = (props) =>(
|
|
|
|
<Col span={12} className="switch-content">
|
|
|
|
<div className="icon-switch">
|
|
|
|
<Icon type="smile-o" />
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<p><b>{props.title}</b></p>
|
|
|
|
<p>{props.des}</p>
|
|
|
|
</div>
|
|
|
|
</Col>
|
|
|
|
)
|
|
|
|
|
|
|
|
IntroPart.propTypes = {
|
|
|
|
title : PropTypes.string,
|
|
|
|
des : PropTypes.string
|
|
|
|
}
|
|
|
|
|
|
|
|
class Intro extends React.Component{
|
|
|
|
constructor(props){
|
|
|
|
super(props);
|
|
|
|
}
|
|
|
|
static propTypes={
|
|
|
|
intro : PropTypes.shape({
|
|
|
|
title:PropTypes.string,
|
|
|
|
des:PropTypes.string,
|
|
|
|
img:PropTypes.string,
|
|
|
|
detail:PropTypes.arrayOf(PropTypes.shape({
|
|
|
|
title:PropTypes.string,
|
|
|
|
des:PropTypes.string
|
|
|
|
}))
|
2017-07-25 15:35:23 +08:00
|
|
|
}),
|
|
|
|
className : PropTypes.string
|
2017-07-17 21:11:58 +08:00
|
|
|
}
|
|
|
|
render(){
|
2017-07-25 15:35:23 +08:00
|
|
|
const { intro } = this.props;
|
|
|
|
const id = "motion";
|
|
|
|
const animType = {
|
|
|
|
queue: 'right',
|
|
|
|
one: { x: '-=30', opacity: 0, type: 'from' }
|
|
|
|
};
|
2017-07-17 21:11:58 +08:00
|
|
|
return(
|
|
|
|
<div className="intro-container">
|
2017-07-25 15:35:23 +08:00
|
|
|
<OverPack
|
|
|
|
playScale="0.3"
|
|
|
|
>
|
|
|
|
<TweenOne
|
|
|
|
animation={animType.one}
|
|
|
|
key={`${id}-img`}
|
|
|
|
resetStyleBool
|
|
|
|
id={`${id}-imgWrapper`}
|
|
|
|
className="imgWrapper"
|
|
|
|
>
|
|
|
|
<div className="img-container" id={`${id}-img-container`}>
|
|
|
|
<img src={intro.img}/>
|
2017-07-17 21:11:58 +08:00
|
|
|
</div>
|
2017-07-25 15:35:23 +08:00
|
|
|
</TweenOne>
|
|
|
|
|
|
|
|
<QueueAnim
|
|
|
|
type={animType.queue}
|
|
|
|
key={`${id}-text`}
|
|
|
|
leaveReverse
|
|
|
|
ease={['easeOutCubic', 'easeInCubic']}
|
|
|
|
id={`${id}-textWrapper`}
|
|
|
|
className={`${id}-text des-container textWrapper`}
|
|
|
|
>
|
|
|
|
<div key={`${id}-des-content`}>
|
2017-07-17 21:11:58 +08:00
|
|
|
<div className="des-title">
|
|
|
|
{intro.title}
|
|
|
|
</div>
|
|
|
|
<div className="des-detail">
|
|
|
|
{intro.des}
|
|
|
|
</div>
|
|
|
|
</div>
|
2017-07-25 15:35:23 +08:00
|
|
|
<div className="des-switch" key={`${id}-des-switch`}>
|
2017-07-17 21:11:58 +08:00
|
|
|
{intro.detail.map(function(item,i){
|
|
|
|
return(<IntroPart key={i} title={item.title} des={item.des}/>)
|
|
|
|
})}
|
|
|
|
</div>
|
2017-07-25 15:35:23 +08:00
|
|
|
</QueueAnim>
|
|
|
|
</OverPack>
|
2017-07-17 21:11:58 +08:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default Intro;
|
|
|
|
|