Commit 15b53963 authored by Sascha Herzinger's avatar Sascha Herzinger
Browse files

Changed annimation to improve performance

parent 30b6b704
......@@ -274,11 +274,13 @@
watch: {
'boxes': {
handler: function (newBoxes) {
Object.keys(newBoxes).forEach(label => {
const labels = Object.keys(newBoxes)
labels.forEach((label, i) => {
if (typeof this.tweened.boxes[label] === 'undefined') {
this.$set(this.tweened.boxes, label, newBoxes[label])
} else {
TweenLite.to(this.tweened.boxes[label], 0.5, newBoxes[label])
TweenLite.to(this.tweened.boxes[label], 0.5 / labels.length,
Object.assign(newBoxes[label], {delay: i * 0.5 / labels.length}))
}
})
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment