2016-01-06 15:38:36 +08:00
|
|
|
|
const React = require('react');
|
|
|
|
|
const ReactDOM = require('react-dom');
|
2016-01-07 16:52:27 +08:00
|
|
|
|
import { QueueAnim, Icon, Button } from '../index';
|
|
|
|
|
import ScrollOverPack from 'rc-scroll-anim/lib/ScrollOverPack';
|
|
|
|
|
import TweenOne from 'rc-tween-one';
|
2016-01-07 16:56:45 +08:00
|
|
|
|
|
2016-01-07 23:47:14 +08:00
|
|
|
|
// 导航处理
|
2016-01-07 16:52:27 +08:00
|
|
|
|
function scrollNavEvent() {
|
|
|
|
|
const scrollTop = document.body.scrollTop || document.documentElement.scrollTop;
|
|
|
|
|
const clientHeight = document.documentElement.clientHeight;
|
|
|
|
|
if (scrollTop >= clientHeight) {
|
|
|
|
|
header.className = header.className.indexOf('home-nav-bottom') >= 0 ? header.className : header.className + ' home-nav-bottom';
|
|
|
|
|
} else {
|
|
|
|
|
header.className = header.className.replace(/home-nav-bottom/ig, '');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-12 15:51:44 +08:00
|
|
|
|
$(window).off('scroll.scrollNavEvent');
|
|
|
|
|
$(window).on('scroll.scrollNavEvent', scrollNavEvent);
|
2016-01-07 16:52:27 +08:00
|
|
|
|
|
|
|
|
|
class Banner extends React.Component {
|
|
|
|
|
constructor() {
|
|
|
|
|
super(...arguments);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
typeFunc(a) {
|
|
|
|
|
if (a.key === 'line') {
|
|
|
|
|
return 'right';
|
|
|
|
|
} else if (a.key === 'button') {
|
|
|
|
|
return 'bottom';
|
|
|
|
|
}
|
|
|
|
|
return 'left';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
return (
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<div>
|
|
|
|
|
<QueueAnim className="banner-text-wrapper" type={this.typeFunc} delay={300}>
|
2016-01-11 11:20:22 +08:00
|
|
|
|
<h2 key="h2">ANT <p>DESIGN</p></h2>
|
2016-01-07 17:47:56 +08:00
|
|
|
|
<p key="content">一个 UI 设计语言</p>
|
2016-01-07 19:50:14 +08:00
|
|
|
|
<span className="line" key="line"/>
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<a key="button" href="/docs/spec/introduce"><Icon type="smile-circle"/>开始探索</a>
|
|
|
|
|
</QueueAnim>
|
2016-01-07 17:47:56 +08:00
|
|
|
|
<TweenOne className='down' vars={[{opacity: 1},{y: 10, duration: 800, yoyo: true, repeat: -1}]}>
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<Icon type="down"/>
|
|
|
|
|
</TweenOne>
|
2016-01-07 17:47:56 +08:00
|
|
|
|
</div>
|
|
|
|
|
)
|
2016-01-07 16:52:27 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-07 23:47:14 +08:00
|
|
|
|
ReactDOM.render(<Banner />, document.getElementById('banner'));
|
2016-01-07 16:52:27 +08:00
|
|
|
|
|
|
|
|
|
// page1
|
2016-01-06 15:38:36 +08:00
|
|
|
|
ReactDOM.render((
|
2016-01-07 16:52:27 +08:00
|
|
|
|
<ScrollOverPack className="content-wrapper">
|
|
|
|
|
<TweenOne key="image" className="image1 image-wrapper" vars={{x: 0, opacity: 1, duration: 550}}
|
|
|
|
|
style={{transform: 'translateX(-100px)', opacity: 0}}/>
|
|
|
|
|
<QueueAnim className="text-wrapper" delay={300} key="text" duration={550} leaveReverse>
|
2016-01-11 11:20:22 +08:00
|
|
|
|
<h2 key="h2">最佳实践</h2>
|
2016-01-08 16:01:37 +08:00
|
|
|
|
<p key="p" style={{maxWidth: 310}}>近一年的中后台设计实践,积累了大量的优秀案例。</p>
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<div key="button"><Button type="primary" size="large" onClick={()=>{window.location.href='/docs/practice/cases'}}>了解更多<Icon
|
|
|
|
|
type="right"/></Button></div>
|
2016-01-07 16:52:27 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
</ScrollOverPack>
|
2016-01-07 23:47:14 +08:00
|
|
|
|
), document.getElementById('page1'));
|
2016-01-07 16:52:27 +08:00
|
|
|
|
|
|
|
|
|
//page2
|
|
|
|
|
ReactDOM.render((
|
|
|
|
|
<ScrollOverPack className="content-wrapper">
|
|
|
|
|
<QueueAnim className="text-wrapper left-text" delay={300} key="text" duration={550} type='bottom' leaveReverse>
|
2016-01-11 11:20:22 +08:00
|
|
|
|
<h2 key="h2">设计模式</h2>
|
2016-01-08 16:01:37 +08:00
|
|
|
|
<p key="p" style={{maxWidth: 260}}>总结中后台设计中反复出现的问题,并提供相应的解决方案。</p>
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<div key="button"><Button type="primary" size="large"
|
|
|
|
|
onClick={()=>{window.location.href='/docs/pattern/navigation'}}>了解更多<Icon type="right"/></Button>
|
|
|
|
|
</div>
|
2016-01-07 16:52:27 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
<TweenOne key="image" className="image2 image-wrapper" vars={{x: 0, opacity: 1, delay: 300, duration: 550}}
|
|
|
|
|
style={{transform: 'translateX(100px)', opacity: 0}}/>
|
|
|
|
|
</ScrollOverPack>
|
2016-01-07 23:47:14 +08:00
|
|
|
|
), document.getElementById('page2'));
|
2016-01-07 16:52:27 +08:00
|
|
|
|
|
2016-01-07 23:47:14 +08:00
|
|
|
|
// page3
|
2016-01-07 16:52:27 +08:00
|
|
|
|
ReactDOM.render((
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<ScrollOverPack className="content-wrapper">
|
2016-01-07 16:52:27 +08:00
|
|
|
|
<TweenOne key="image" className="image3 image-wrapper" vars={{x: 0, opacity: 1, duration: 550}}
|
|
|
|
|
style={{transform: 'translateX(-100px)', opacity: 0}}/>
|
|
|
|
|
<QueueAnim className="text-wrapper" delay={300} key="text" duration={550} leaveReverse style={{top: '40%'}}>
|
2016-01-11 14:38:51 +08:00
|
|
|
|
<h2 key="h2">丰富的基础组件</h2>
|
|
|
|
|
<p key="p" style={{maxWidth: 280}}>大量灵活实用的基础组件,为业务产品提供强有力的设计支持。</p>
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<div key="button"><Button type="primary" size="large"
|
|
|
|
|
onClick={()=>{window.location.href='/docs/react/introduce'}}>了解更多<Icon
|
|
|
|
|
type="right"/></Button></div>
|
2016-01-07 16:52:27 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
</ScrollOverPack>
|
2016-01-07 23:47:14 +08:00
|
|
|
|
), document.getElementById('page3'));
|
2016-01-07 16:52:27 +08:00
|
|
|
|
|
2016-01-07 23:47:14 +08:00
|
|
|
|
// page4
|
2016-01-07 16:52:27 +08:00
|
|
|
|
ReactDOM.render((
|
2016-01-07 17:24:44 +08:00
|
|
|
|
<ScrollOverPack className="content-wrapper">
|
2016-01-07 16:52:27 +08:00
|
|
|
|
<QueueAnim className="text-wrapper-bottom" delay={300} key="text" duration={550} leaveReverse type="bottom">
|
2016-01-11 11:20:22 +08:00
|
|
|
|
<h2 key="h2">微小·确定·幸福</h2>
|
2016-01-08 16:01:37 +08:00
|
|
|
|
<p key="p">这是一套致力于提升『用户』和『设计者』使用体验的中后台设计语言。</p>
|
2016-01-07 16:52:27 +08:00
|
|
|
|
</QueueAnim>
|
|
|
|
|
<TweenOne key="image" className="image4 bottom-wrapper" vars={{y: 0, opacity: 1, duration: 550, delay: 550}}
|
|
|
|
|
style={{transform: 'translateY(50px)', opacity: 0}}/>
|
|
|
|
|
</ScrollOverPack>
|
2016-01-07 23:47:14 +08:00
|
|
|
|
), document.getElementById('page4'));
|