From 7e341a1be98016f1ba26da3a7ad89f34c96f112c Mon Sep 17 00:00:00 2001 From: jljsj Date: Thu, 7 Jan 2016 16:52:27 +0800 Subject: [PATCH 1/2] add new home --- package.json | 2 + scripts/home.js | 111 ++++++++++++++- site/templates/home.html | 228 ++++++++++++++++++++++++++++++- style/themes/default/custom.less | 6 +- 4 files changed, 334 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index c19acd4878..4e2c001647 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,8 @@ "warning": "~2.1.0" }, "devDependencies": { + "rc-scroll-anim": "0.0.5", + "rc-tween-one": "0.1.5", "autoprefixer-loader": "^3.1.0", "babel-cli": "^6.2.0", "babel-core": "^6.2.1", diff --git a/scripts/home.js b/scripts/home.js index 29e83b3651..9b06e9db60 100644 --- a/scripts/home.js +++ b/scripts/home.js @@ -1,8 +1,111 @@ const React = require('react'); const ReactDOM = require('react-dom'); +import { QueueAnim, Icon, Button } from '../index'; +import ScrollOverPack from 'rc-scroll-anim/lib/ScrollOverPack'; +import EventDispatcher from 'rc-scroll-anim/lib/EventDispatcher'; +import TweenOne from 'rc-tween-one'; +console.log(EventDispatcher) +const DivId = ['page4', 'page3', 'page2', 'page1', 'banner']; +const header = document.getElementById('header'); +DivId.forEach(id=> { + const page = document.createElement('section'); + page.id = id; + if (id.indexOf('page') >= 0) { + page.className = 'page'; + } + document.body.insertBefore(page, header.nextSibling); +}); +// 导航处理; +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, ''); + } +} + +EventDispatcher.addEventListener('scroll.scrollNavEvent', scrollNavEvent); + +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

V1.0

+

一套面向中后台的设计解决方案

+ + 开始探索 +
) + } +} + +ReactDOM.render(, banner); + + +// page1 ReactDOM.render(( -
- 首页坑位 -
-), document.getElementById('home-container')); + + + +

实例/优秀的设计实践

+

近一年的蚂蚁中后台设计实践,积累了大量的优秀案例。

+
+
+
+), page1); + +//page2 +ReactDOM.render(( + + +

设计模式库

+

为中后台设计中反复出现的问题提供一套相应的解决方案

+
+
+ +
+), page2); + +//page3 +ReactDOM.render(( + + + +

30+的基础设计组件

+

为中后台设计中反复出现的问题提供一套相应的解决方案

+
+
+
+), page3); + + +//page4 +ReactDOM.render(( + + + +

微小·确定·幸福

+

为中后台设计中反复出现的问题提供一套相应的解决方案

+
+ +
+), page4); diff --git a/site/templates/home.html b/site/templates/home.html index 56e14029fc..5a0c05d207 100644 --- a/site/templates/home.html +++ b/site/templates/home.html @@ -3,13 +3,229 @@ {% block bodyAttribute %}class="index-page"{% endblock %} {% block content %} -
{% endblock %} diff --git a/style/themes/default/custom.less b/style/themes/default/custom.less index c092a064c8..b80e1a9db5 100644 --- a/style/themes/default/custom.less +++ b/style/themes/default/custom.less @@ -35,9 +35,9 @@ @ease-out : cubic-bezier(0.215, 0.61, 0.355, 1); @ease-in : cubic-bezier(0.55, 0.055, 0.675, 0.19); @ease-in-out : cubic-bezier(0.645, 0.045, 0.355, 1); -@ease-out-back : cubic-bezier(0.18, 0.89, 0.32, 1.28); -@ease-in-back : cubic-bezier(0.6, -0.3, 0.74, 0.05); -@ease-in-out-back : cubic-bezier(0.68, -0.55, 0.27, 1.55); +@ease-out-back : cubic-bezier(0.12, 0.4, 0.29, 1.46); +@ease-in-back : cubic-bezier(0.71, -0.46, 0.88, 0.6); +@ease-in-out-back : cubic-bezier(0.71, -0.46, 0.29, 1.46); @ease-out-circ : cubic-bezier(0.08, 0.82, 0.17, 1); @ease-in-circ : cubic-bezier(0.6, 0.04, 0.98, 0.34); @ease-in-out-circ : cubic-bezier(0.78, 0.14, 0.15, 0.86); From c64d6f3a0f7028d2a580065b205cdf4428a23dc5 Mon Sep 17 00:00:00 2001 From: jljsj Date: Thu, 7 Jan 2016 16:56:45 +0800 Subject: [PATCH 2/2] remove console.log --- scripts/home.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/home.js b/scripts/home.js index 9b06e9db60..bfd45e296e 100644 --- a/scripts/home.js +++ b/scripts/home.js @@ -4,7 +4,7 @@ import { QueueAnim, Icon, Button } from '../index'; import ScrollOverPack from 'rc-scroll-anim/lib/ScrollOverPack'; import EventDispatcher from 'rc-scroll-anim/lib/EventDispatcher'; import TweenOne from 'rc-tween-one'; -console.log(EventDispatcher) + const DivId = ['page4', 'page3', 'page2', 'page1', 'banner']; const header = document.getElementById('header'); DivId.forEach(id=> { @@ -96,7 +96,6 @@ ReactDOM.render(( ), page3); - //page4 ReactDOM.render((