import React from 'react'
import styles from './styles.scss'
class FigureAnimate extends React.PureComponent {
  constructor (props) {
    super()
    this.state = {
      imgTransform: null
    }
    this.time = null
  }
  componentDidMount () {
    this.time = setTimeout(() => {
      this.setState({
        imgTransform: {
          transform: 'scale(1, 1)'
        }
      })
    }, 1000)
  }
  componentWillUnmount () {
    clearTimeout(this.time)
  }
  render () {
    const { cls } = this.props
    return (
      <figure className={styles[cls]}>
        <img
          src='http://7xpwuf.com1.z0.glb.clouddn.com/WechatIMG13.jpeg'
          height='300'
          width='685'
          className={styles.KenBurns}
          style={this.state.imgTransform}
        />
        <figcaption>
          <h2>图片标题</h2>
          <p>图片注解</p>
          <p>图片注解</p>
          <div />
        </figcaption>
      </figure>
    )
  }
}

export default FigureAnimate
          <p>大图片注解</p>