提交 afdbe454 编写于 作者: Y yiminghe

remove velocity-anim

上级 1fbfb677
let velocity;
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
velocity = require('velocity-animate');
}
function animate(node, show, transitionName, done) {
let ok;
import cssAnimation from 'css-animation';
function complete() {
if (!ok) {
ok = true;
function animate(node, show, done) {
let height;
return cssAnimation(node, 'ant-motion-collapse', {
start() {
if (!show) {
node.style.height = `${node.offsetHeight}px`;
} else {
height = node.offsetHeight;
node.style.height = 0;
}
},
active() {
node.style.height = `${show ? height : 0}px`;
},
end() {
node.style.height = '';
done();
}
}
// Fix safari flash bug
/*eslint-disable */
node.style.display = show ? 'block' : 'none';
/*eslint-enable */
velocity(node, transitionName, {
duration: 240,
complete,
easing: 'easeInOutQuad'
},
});
return {
stop() {
velocity(node, 'finish');
complete();
}
};
}
const animation = {
enter(node, done) {
return animate(node, false, 'slideDown', done);
return animate(node, true, done);
},
leave(node, done) {
return animate(node, true, 'slideUp', done);
return animate(node, false, done);
},
appear(node, done) {
return animate(node, false, 'slideDown', done);
return animate(node, true, done);
},
};
......
......@@ -12,6 +12,10 @@
border-radius: 3px;
border: 1px solid @border-color-base;
&-anim-active {
transition: height .2s ease-out;
}
& > &-item {
border-top: 1px solid @border-color-base;
&:first-child {
......@@ -49,7 +53,6 @@
}
&-content {
display: none;
overflow: hidden;
color: @text-color;
padding: 0 16px;
......@@ -60,8 +63,8 @@
padding-bottom: 16px;
}
&-active {
display: block;
&-inactive {
display: none;
}
}
......
......@@ -29,6 +29,13 @@
}
}
.ant-motion-collapse {
overflow: hidden;
&-active {
transition: height .2s ease-out;
}
}
@import "motion/fade";
@import "motion/move";
@import "motion/other";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册