const React = require('react'); const ReactDOM = require('react-dom'); import { QueueAnim, Icon, Button } from '../index'; import ScrollOverPack from 'rc-scroll-anim/lib/ScrollOverPack'; import ScrollLink from 'rc-scroll-anim/lib/ScrollLink'; import ScrollElement from 'rc-scroll-anim/lib/ScrollElement'; import scrollScreen from 'rc-scroll-anim/lib/ScrollScreen'; import ScrollEvent from 'rc-scroll-anim/lib/EventDispatcher'; import mapped from 'rc-scroll-anim/lib/Mapped'; import TweenOne from 'rc-tween-one'; module.exports = function() { InstantClickChangeFns.push(function() { if (!document.getElementById('banner')) { // componentWillUnmount 不会触发, 手动删掉事件; ScrollEvent._listeners = {}; mapped.unMount(); return; } // 导航处理 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, ''); } } $(window).off('scroll.scrollNavEvent'); $(window).on('scroll.scrollNavEvent', scrollNavEvent); // list point class Link extends React.Component { componentDidMount() { // 整屏滚动; scrollScreen.init({docHeight: 4746}); } render() { return (
); } } ReactDOM.render(, document.getElementById('list')); // banner 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 (

ANT

DESIGN

一个 UI 设计语言

开始探索