Skip to content

Commit

Permalink
fix(MdProgressSpinner): improve transition (#1946)
Browse files Browse the repository at this point in the history
* Fix MdProgressSpinner transition

* Use CSS transition duration instead of explicit variable

* Add missing watcher for mdValue and mdStroke
  • Loading branch information
supachailllpay authored and marcosmoura committed May 12, 2019
1 parent 76274e8 commit 0e62ae7
Showing 1 changed file with 23 additions and 6 deletions.
29 changes: 23 additions & 6 deletions src/components/MdProgress/MdProgressSpinner/MdProgressSpinner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,15 @@
}
},
watch: {
mdValue () {
this.attachCircleStyle()
},
mdDiameter () {
this.attachSvgStyle()
this.attachCircleStyle()
},
mdStroke () {
this.attachCircleStyle()
}
},
methods: {
Expand Down Expand Up @@ -169,7 +175,7 @@
transform: rotate(4680deg)
}
}
@keyframes md-progress-spinner-stroke-rotate {
0% {
stroke-dashoffset: var(--md-progress-spinner-start-value);
Expand Down Expand Up @@ -260,31 +266,42 @@
animation: md-progress-spinner-rotate 2s linear infinite;
&.md-progress-spinner-enter,
&.md-progress-spinner-leave-active {
transition-duration: .4s;
&.md-progress-spinner-leave-to {
.md-progress-spinner-draw {
opacity: 0;
transform: scale(.1);
}
}
&.md-progress-spinner-enter-active,
&.md-progress-spinner-leave-active {
transition-duration: .4s;
animation: none;
}
.md-progress-spinner-circle {
animation: 4s infinite $md-transition-stand-timing;
animation-name: md-progress-spinner-stroke-rotate;
}
}
&.md-determinate {
&.md-progress-spinner-enter-active,
&.md-progress-spinner-leave-active {
&.md-progress-spinner-enter-active {
transition-duration: 2s;
.md-progress-spinner-draw {
animation: md-progress-spinner-initial-rotate 1.98s $md-transition-stand-timing forwards;
}
}
&.md-progress-spinner-leave-active {
transition-duration: 2s;
.md-progress-spinner-draw {
animation: md-progress-spinner-initial-rotate reverse 1.98s $md-transition-stand-timing forwards;
}
}
.md-progress-spinner-draw {
transition: none;
}
Expand Down

0 comments on commit 0e62ae7

Please sign in to comment.