ant-design/site/component/Home/Banner.jsx

44 lines
1.4 KiB
React
Raw Normal View History

2016-03-03 17:23:08 +08:00
import React from 'react';
import { Link } from 'react-router';
import ScrollElement from 'rc-scroll-anim/lib/ScrollElement';
import TweenOne from 'rc-tween-one';
2016-03-14 15:00:11 +08:00
import GitHubButton from 'react-github-button';
import 'react-github-button/assets/style.css';
2016-04-11 10:12:48 +08:00
import { Icon } from 'antd';
2016-03-30 19:14:09 +08:00
import QueueAnim from 'rc-queue-anim';
2016-03-03 17:23:08 +08:00
export default class Banner extends React.Component {
typeFunc(a) {
if (a.key === 'line') {
return 'right';
} else if (a.key === 'button') {
return 'bottom';
}
return 'left';
}
render() {
return (
<section id="banner">
<ScrollElement scrollName="banner" className="page">
<QueueAnim className="banner-text-wrapper" type={this.typeFunc} delay={300}>
<h2 key="h2">ANT <p>DESIGN</p></h2>
<p key="content">一个 UI 设计语言</p>
<span className="line" key="line" />
2016-03-24 11:03:32 +08:00
<div key="button" className="start-button clearfix">
<Link to="/docs/spec/introduce">
2016-03-14 15:00:11 +08:00
<Icon type="smile-circle" />开始探索
</Link>
</div>
2016-03-24 11:03:32 +08:00
<GitHubButton key="github-button" type="stargazers"
2016-03-14 15:00:11 +08:00
namespace="ant-design" repo="ant-design" />
2016-03-03 17:23:08 +08:00
</QueueAnim>
2016-04-11 16:06:20 +08:00
<TweenOne className="down" animation={[{ opacity: 1 }, { y: 10, duration: 800, yoyo: true, repeat: -1 }]}>
2016-03-03 17:23:08 +08:00
<Icon type="down" />
</TweenOne>
</ScrollElement>
</section>
);
}
}