Skip to content

Commit

Permalink
feat: 优化动画执行函数
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzhenfei committed Sep 29, 2020
1 parent 8ce6761 commit c8ee39d
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion components/pi-checkbox/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ $disable-color: #c8c9cc;
overflow: hidden;
color: #cccccc;
border: 4rpx solid $disable-color;
transition: all $pi-animation-duration ease-in-out;
transition: all $pi-animation-duration $pi-animation-timing-function;
&.line {
&.active {
color: $pi-primary-color;
Expand Down
1 change: 0 additions & 1 deletion components/pi-count-down/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export default {
},
methods: {
run() {
// 避免可能出现的倒计时重叠情况
this.clearTimer()
if (this.timestamp <= 0) return
this.timer = setInterval(() => {
Expand Down
2 changes: 1 addition & 1 deletion components/pi-line-progress/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ export default {
white-space: nowrap;
vertical-align: middle;
background: $pi-primary-color;
transition: all $pi-animation-duration ease-in-out;
transition: all $pi-animation-duration $pi-animation-timing-function;
&::after {
display: inline-block;
height: 100%;
Expand Down
4 changes: 2 additions & 2 deletions components/pi-popup/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ export default {

<style lang="scss" scoped>
.ani-scale-center-up {
animation: scale-center-up $pi-animation-duration ease-in-out both;
animation: scale-center-up $pi-animation-duration $pi-animation-timing-function both;
}
.ani-scale-center-down {
animation: scale-center-down $pi-animation-duration ease-in-out both;
animation: scale-center-down $pi-animation-duration $pi-animation-timing-function both;
}
@keyframes scale-center-up {
Expand Down
4 changes: 2 additions & 2 deletions components/pi-tabs/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ export default {
.pi-tab {
display: inline-block;
text-align: center;
transition: all $pi-animation-duration ease-in-out;
transition: all $pi-animation-duration $pi-animation-timing-function;
&.active {
color: $pi-primary-color;
}
Expand All @@ -307,7 +307,7 @@ export default {
overflow: hidden;
background-color: $pi-primary-color;
transition-delay: $pi-animation-duration;
transition-timing-function: ease-in-out;
transition-timing-function: $pi-animation-timing-function;
transition-property: all;
}
}
Expand Down
2 changes: 1 addition & 1 deletion mixin/page-transitions/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ uni-page.animation-show {

uni-page.animation-enter,
uni-page.animation-leave {
transition: all 0.3s ease-in-out;
transition: all 0.3s $pi-animation-timing-function;
}

uni-page.animation-forward {
Expand Down
2 changes: 1 addition & 1 deletion scss/animation.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[class*='pi-ani-'] {
animation-duration: $pi-animation-duration;
animation-timing-function: ease-in-out;
animation-timing-function: $pi-animation-timing-function;
animation-fill-mode: both;
}

Expand Down
1 change: 1 addition & 0 deletions scss/variable.scss
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ $pi-content-padding: 24rpx !default; // pi-content内容区域默认padding

// 动画
$pi-animation-duration: 0.3s !default; // 动画执行时长
$pi-animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1) !default; // 动画执行函数

// 颜色
$pi-font-color: #666666 !default; // 文字颜色
Expand Down

0 comments on commit c8ee39d

Please sign in to comment.