mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-21 02:36:28 +10:00
572 lines
18 KiB
HTML
572 lines
18 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||
<meta name="format-detection" content="telephone=no">
|
||
<meta name="description" content="一个 UI 设计语言"/>
|
||
<title>
|
||
自然运动 - Ant Design
|
||
</title>
|
||
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
||
<link rel="shortcut icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
||
|
||
<link rel="stylesheet" href="../../dist/demo.css">
|
||
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.5.7/es5-shim.min.js,es5-shim/4.5.7/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js,jquery/1.11.3/jquery.min.js,bluebird/3.1.1/bluebird.min.js"></script>
|
||
<script>
|
||
(function() {
|
||
window.ANT_COMPONENTS = [];
|
||
window.InstantClickChangeFns = [];
|
||
ANT_COMPONENTS.push({
|
||
title: 'Pagination',
|
||
desc: '分页'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Affix',
|
||
desc: '固钉'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Badge',
|
||
desc: '徽标数'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Breadcrumb',
|
||
desc: '面包屑'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Button',
|
||
desc: '按钮'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Calendar',
|
||
desc: '日历'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Carousel',
|
||
desc: '走马灯'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Cascader',
|
||
desc: '级联选择'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Checkbox',
|
||
desc: '多选框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Collapse',
|
||
desc: '折叠面板'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'DatePicker',
|
||
desc: '日期选择框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Dropdown',
|
||
desc: '下拉菜单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Form',
|
||
desc: '表单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Icon',
|
||
desc: '图标'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'InputNumber',
|
||
desc: '数字输入框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Layout',
|
||
desc: '布局'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Menu',
|
||
desc: '导航菜单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Message',
|
||
desc: '全局提示'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Modal',
|
||
desc: '对话框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Notification',
|
||
desc: '通知提醒框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Alert',
|
||
desc: '警告提示'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Popconfirm',
|
||
desc: '气泡确认框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Popover',
|
||
desc: '气泡卡片'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Progress',
|
||
desc: '进度条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'QueueAnim',
|
||
desc: '进出场动画'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Radio',
|
||
desc: '单选框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Select',
|
||
desc: '选择器'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Slider',
|
||
desc: '滑动输入条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Spin',
|
||
desc: '加载中'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Steps',
|
||
desc: '步骤条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Switch',
|
||
desc: '开关'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Table',
|
||
desc: '表格'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tabs',
|
||
desc: '标签页'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tag',
|
||
desc: '标签'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'TimePicker',
|
||
desc: '时间选择框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Timeline',
|
||
desc: '时间轴'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tooltip',
|
||
desc: '文字提示'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Transfer',
|
||
desc: '穿梭框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tree',
|
||
desc: '树形控件'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'TreeSelect',
|
||
desc: '树选择'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Upload',
|
||
desc: '上传'
|
||
});
|
||
// fix ie location origin
|
||
// http://stackoverflow.com/questions/22564167/window-location-origin-gives-wrong-value-when-using-ie
|
||
if (!window.location.origin) {
|
||
window.location.origin = window.location.protocol + "//"
|
||
+ window.location.hostname
|
||
+ (window.location.port ? ':' + window.location.port : '');
|
||
}
|
||
var i = location.pathname.split('/').lastIndexOf('ant-design');
|
||
if (i > 0) {
|
||
window.rootUrl = location.origin + location.pathname.split('/').slice(0, 2+1).join('/');
|
||
} else {
|
||
window.rootUrl = location.origin;
|
||
}
|
||
})();
|
||
</script>
|
||
<script>
|
||
window.antdVersion = {
|
||
latest: '0.12.12'
|
||
};
|
||
</script>
|
||
<script src="../../dist/demo.js"></script>
|
||
|
||
</head>
|
||
<body >
|
||
<header id="header" class="clearfix">
|
||
<a class="logo" href="../..">
|
||
<img width="60" src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg">
|
||
Ant Design
|
||
</a>
|
||
<div class="search">
|
||
<div id="autoComplete"></div>
|
||
</div>
|
||
<nav class="nav" tabindex="-1">
|
||
<span class="bar"></span>
|
||
<ul>
|
||
<li class="">
|
||
<a href="../..">首页</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../practice/cases">实践</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../pattern/navigation">模式</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../react/introduce">组件</a>
|
||
</li>
|
||
<li class="current">
|
||
<a href="./introduce">语言</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../resource/download">资源</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
<div class="nav-phone-icon"></div>
|
||
</header>
|
||
<div class="main-wrapper">
|
||
|
||
<aside class="aside-container">
|
||
<ul>
|
||
<li class="">
|
||
<a href="introduce"
|
||
class="">
|
||
Ant Design
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="feature"
|
||
class="">
|
||
三大特性
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li open="open">
|
||
<h4>十大原则</h4>
|
||
<ul class="">
|
||
<li class="">
|
||
<a href="principle"
|
||
class="">
|
||
引言
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="proximity"
|
||
class="">
|
||
亲密性
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="alignment"
|
||
class="">
|
||
对齐
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="contrast"
|
||
class="">
|
||
对比
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="repetition"
|
||
class="">
|
||
重复
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="direct"
|
||
class="">
|
||
直截了当
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="lightweight"
|
||
class="">
|
||
简化交互
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="stay"
|
||
class="">
|
||
足不出户
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="invitation"
|
||
class="">
|
||
提供邀请
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="transition"
|
||
class="">
|
||
巧用过渡
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="reaction"
|
||
class="">
|
||
即时反应
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li open="open">
|
||
<h4>设计基础</h4>
|
||
<ul class="">
|
||
<li class="">
|
||
<a href="font"
|
||
class="">
|
||
字体
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="typography"
|
||
class="">
|
||
排版
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="colors"
|
||
class="">
|
||
色彩
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="layout/"
|
||
class="">
|
||
常用布局
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li open="open">
|
||
<h4>动画</h4>
|
||
<ul class="">
|
||
<li class="current">
|
||
<a href="easing"
|
||
class="">
|
||
自然运动
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="motion"
|
||
class="">
|
||
组件动画
|
||
<span class="chinese"></span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</aside>
|
||
|
||
<section class="main-container">
|
||
<article class="markdown">
|
||
<h1>自然运动 <span class="subtitle"></span></h1>
|
||
|
||
|
||
<div class="toc"><ul><li><a href="#质量和重量">质量和重量</a></li><li><a href="#缓动函数">缓动函数</a></li></ul></div>
|
||
<p>现实物体照着一定节奏移动,并不是一开始就移动很快的。</p>
|
||
<p>当我们打开现代家具的门或抽屉时,首先会让它加速,然后慢下来。</p>
|
||
<p>当电梯开关门时,它在打开或关闭时都有一段缓冲带,是先加速,然后慢下来。</p>
|
||
<p>当某个东西往下掉时,首先是越掉越快,撞到地上后回弹,最终才又碰触地板。</p>
|
||
<h2 id="质量和重量">质量和重量<a href="#质量和重量" class="anchor">#</a> </h2><p>在物理世界里,是以力量附加到物体对象里,加上自身的质量才完成一段动画。力量的持续时间决定物体的加速,减速与改变方向。</p>
|
||
<p>动画停止与启动都不是瞬间完成的,因它需要一段缓冲的时间来加速或减速,因此,当动画有突然启动,停止或改变方向,都会显得很不自然。</p>
|
||
<blockquote>
|
||
<p>以下图形,红色线与圆环为不推荐示例,蓝色为推荐示例。</p>
|
||
</blockquote>
|
||
<h4 id="自然缓动">自然缓动<a href="#自然缓动" class="anchor">#</a> </h4><p>不要用直线缓动 Linear 做物体位移或出入动画的缓动;注:Linear 函数可做循环动画函数。</p>
|
||
<p>如下图所示,在没有缓动的情况下启动与停止都显得突兀,感觉动画还没结束就停止了,所以在物体运动中避免直线运动。</p>
|
||
<div id="J-Linear"></div>
|
||
|
||
|
||
<p>上图所示缓动函数:红 <code>Linear</code>,蓝 <code>ease-in-out</code>。</p>
|
||
<h4 id="出入动画">出入动画<a href="#出入动画" class="anchor">#</a> </h4><p>不要做单向动画,进场后不做出场,直接消失元素或回到原点,会造成整体效果不协调和用户视觉上的闪现或其它不好的效果。</p>
|
||
<p>所以有动画的进场必须要有动画的出场,包括导航上的动画。</p>
|
||
<div id="J-Symmetric"></div>
|
||
|
||
|
||
<p>上图所示缓动函数:红 <code>ease-in-out</code>,蓝 <code>ease-in-out-cubic</code>。</p>
|
||
<h5 id="场外出入">场外出入<a href="#场外出入" class="anchor">#</a> </h5><p>场外出入需要考虑力量与引力的关系,如向空中抛物体时,物体的初速度是最快的。</p>
|
||
<p>上升过程中物体受到引力的作用,速度也随之匀速降低,高度在时间轴上呈现抛物线弧度。</p>
|
||
<p>物体达到最高点速度减为 0,然后物体下降,速度受重力作用匀速增加。</p>
|
||
<p>所以最高点前后都有一定缓冲带,曲线呈现抛物线的规律。不要做图示红色球体下降时的缓动。</p>
|
||
<div id="J-Entry"></div>
|
||
|
||
|
||
<p>上图所示缓动函数:红 <code>ease-out</code> <code>ease-out</code>,蓝 <code>ease-out-cubic</code> <code>ease-in-cubic</code>。</p>
|
||
<p>示例组件:<a href="/components/message/">Message 全局提示</a>,<a href="/components/dropdown/">Dropdown 下拉菜单</a>。</p>
|
||
<h4 id="弹性动画">弹性动画<a href="#弹性动画" class="anchor">#</a> </h4><ol>
|
||
<li><p>如蹦极跳下来时,刚跳下时速度很快,到达绳子的长度后,由于物体的重量再将绳子拉长再反弹,弹动几次后才停下。</p>
|
||
<p>动画里也由质量来决定它的反弹,一般元素最好只弹动一次就够了,收回时可以用向下浮动再上拉或直接前缓动,可适用在下拉框与弹出元素。</p>
|
||
</li>
|
||
<li><p>如球类物体掉地上的后,反弹几次后停止。</p>
|
||
<p>弹性动画最好结合 alpha。</p>
|
||
</li>
|
||
</ol>
|
||
<blockquote>
|
||
<p>慎用 Bounce 或 Elastic,这两种适用在特殊元素下,一般 back 即可满足页面上元素的弹动;</p>
|
||
</blockquote>
|
||
<p><div id="J-Back"></div></p>
|
||
<script src="../../static/motionDemoLoad.js?page=easing"></script>
|
||
|
||
<p>上图所示缓动函数:绿 <code>easeOutBounce</code> <code>easeOutElastic</code>(css 需自配), 蓝 <code>ease-out-back</code> <code>ease-in-back</code>。</p>
|
||
<h2 id="缓动函数">缓动函数<a href="#缓动函数" class="anchor">#</a> </h2><p>Ant Design 提供了一套缓动函数规范动画行为供组件使用。</p>
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>名称</th>
|
||
<th>参数</th>
|
||
<th>说明</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>@ease-out</td>
|
||
<td><code>cubic-bezier(0.215,0.61,0.355,1);</code></td>
|
||
<td>默认后缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in</td>
|
||
<td><code>cubic-bezier(0.55,0.055,0.675,0.19);</code></td>
|
||
<td>默认前缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-out</td>
|
||
<td><code>cubic-bezier(0.645,0.045,0.355,1);</code></td>
|
||
<td>默认前后缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-out-back</td>
|
||
<td><code>cubic-bezier(0.18,0.89,0.32,1.28);</code></td>
|
||
<td>结束回动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-back</td>
|
||
<td><code>cubic-bezier(0.6,-0.3,0.74,0.05);</code></td>
|
||
<td>开始回动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-out-back</td>
|
||
<td><code>cubic-bezier(0.68,-0.55,0.27,1.55);</code></td>
|
||
<td>前后回动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-out-circ</td>
|
||
<td><code>cubic-bezier(0.08,0.82,0.17,1);</code></td>
|
||
<td>圆形后缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-circ</td>
|
||
<td><code>cubic-bezier(0.6,0.04,0.98,0.34);</code></td>
|
||
<td>圆形前缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-out-circ</td>
|
||
<td><code>cubic-bezier(0.78,0.14,0.15,0.86);</code></td>
|
||
<td>圆形前后缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-out-quint</td>
|
||
<td><code>cubic-bezier(0.23, 1, 0.32, 1);</code></td>
|
||
<td>quint 后缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-quint</td>
|
||
<td><code>cubic-bezier(0.755, 0.05, 0.855, 0.06);</code></td>
|
||
<td>quint 前缓动</td>
|
||
</tr>
|
||
<tr>
|
||
<td>@ease-in-out-quint</td>
|
||
<td><code>cubic-bezier(0.86, 0, 0.07, 1);</code></td>
|
||
<td>quint 前后缓动</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</article>
|
||
</section>
|
||
|
||
</div><footer id="footer">
|
||
<ul>
|
||
<li>
|
||
<h2>GitHub</h2>
|
||
<a target="_blank "href="https://github.com/ant-design/ant-design">仓库</a>
|
||
<a target="_blank" href="https://github.com/ant-design/antd-init">脚手架</a>
|
||
<a target="_blank" href="http://ant-tool.github.io/">开发工具</a>
|
||
</li>
|
||
<li>
|
||
<h2>关于我们</h2>
|
||
<a target="_blank" href="https://github.com/ant-ued/blog">博客 - Ant UED</a>
|
||
</li>
|
||
<li>
|
||
<h2>联系我们</h2>
|
||
<a target="_blank" href="https://github.com/ant-design/ant-design/issues">反馈和建议</a>
|
||
<a target="_blank" href="https://gitter.im/ant-design/ant-design">讨论</a>
|
||
<a target="_blank" href="http://dwz.cn/2AF9ao">报告 Bug</a>
|
||
</li>
|
||
<li>
|
||
<div>©2015 蚂蚁金服体验技术部出品</div>
|
||
<div>文档版本:<span id="versions-select"></span></div>
|
||
</li>
|
||
</ul>
|
||
</footer>
|
||
<script data-no-instant>
|
||
if (!location.port) {
|
||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
||
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
||
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
||
ga('create', 'UA-72788897-1', 'auto');
|
||
ga('send', 'pageview');
|
||
InstantClick.on('change', function() {
|
||
ga('send', 'pageview', location.pathname + location.search);
|
||
});
|
||
}
|
||
</script>
|
||
<script data-no-instant>
|
||
InstantClick.on('change', function() {
|
||
InstantClickChangeFns.forEach(function(fn) {
|
||
fn();
|
||
});
|
||
});
|
||
InstantClick.init();
|
||
</script>
|
||
</body>
|
||
</html> |