diff --git a/scripts/devil.js b/scripts/devil.js deleted file mode 100644 index 1d2e0bbd02..0000000000 --- a/scripts/devil.js +++ /dev/null @@ -1,31 +0,0 @@ -'use strict'; - -const babel = require('babel-core'); -const recast = require('recast'); -const builders = recast.types.builders; - -const babelrc = { - presets: ['es2015', 'react'] -}; - -// const demo = 'import { Button } from \'antd\';' + -// 'ReactDOM.render(
' + -// ' ' + -// ' ' + -// ' ' + -// '
,' + -// 'document.getElementById(\'components-button-demo-basic\'));'; -// devil(demo); -module.exports = function devil(demo, params) { - const compiled = babel.transform(demo, babelrc).code; - - const ast = recast.parse(compiled); - const astProgramBody = ast.program.body; - const lastIndex = astProgramBody.length - 1; - astProgramBody[lastIndex] = builders.returnStatement( - astProgramBody[lastIndex].expression.arguments[0] - ); - - const code = recast.print(ast).code; - return new Function((params || []).join(', '), code); -} diff --git a/scripts/home.js b/scripts/home.js deleted file mode 100644 index df469f094a..0000000000 --- a/scripts/home.js +++ /dev/null @@ -1,175 +0,0 @@ -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 设计语言

- -
- 开始探索 -
-