Skip to content

Commit d4d678f

Browse files
authored
Add "Bringing Designs to Life" section to state transitions guide (#1043)
1 parent 5dce966 commit d4d678f

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

src/v2/guide/transitioning-state.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ new Vue({
140140
requestAnimationFrame(animate)
141141
}
142142
}
143-
143+
144144
new TWEEN.Tween(this.tweenedColor)
145145
.to(this.color, 750)
146146
.start()
147-
147+
148148
animate()
149149
}
150150
},
@@ -216,11 +216,11 @@ new Vue({
216216
requestAnimationFrame(animate)
217217
}
218218
}
219-
219+
220220
new TWEEN.Tween(this.tweenedColor)
221221
.to(this.color, 750)
222222
.start()
223-
223+
224224
animate()
225225
}
226226
},
@@ -442,14 +442,14 @@ Vue.component('animated-integer', {
442442
requestAnimationFrame(animate)
443443
}
444444
}
445-
445+
446446
new TWEEN.Tween({ tweeningValue: startValue })
447447
.to({ tweeningValue: endValue }, 500)
448448
.onUpdate(function () {
449449
vm.tweeningValue = this.tweeningValue.toFixed(0)
450450
})
451451
.start()
452-
452+
453453
animate()
454454
}
455455
}
@@ -512,14 +512,14 @@ Vue.component('animated-integer', {
512512
requestAnimationFrame(animate)
513513
}
514514
}
515-
515+
516516
new TWEEN.Tween({ tweeningValue: startValue })
517517
.to({ tweeningValue: endValue }, 500)
518518
.onUpdate(function () {
519519
vm.tweeningValue = this.tweeningValue.toFixed(0)
520520
})
521521
.start()
522-
522+
523523
animate()
524524
}
525525
}
@@ -540,3 +540,16 @@ new Vue({
540540
{% endraw %}
541541

542542
Within child components, we can use any combination of transition strategies that have been covered on this page, along with those offered by Vue's [built-in transition system](transitions.html). Together, there are very few limits to what can be accomplished.
543+
544+
## Bringing Designs to Life
545+
546+
To animate, by one definition, means to bring to life. Unfortunately, when designers create icons, logos, and mascots, they're usually delivered as images or static SVGs. So although GitHub's octocat, Twitter's bird, and many other logos resemble living creatures, they don't really seem alive.
547+
548+
Vue can help. Since SVGs are just data, we only need examples of what these creatures look like when excited, thinking, or alarmed. Then Vue can help transition between these states, making your welcome pages, loading indicators, and notifications more emotionally compelling.
549+
550+
Sarah Drasner demonstrates this in the demo below, using a combination of timed and interactivity-driven state changes:
551+
552+
<p data-height="265" data-theme-id="light" data-slug-hash="YZBGNp" data-default-tab="result" data-user="sdras" data-embed-version="2" data-pen-title="Vue-controlled Wall-E" class="codepen">See the Pen <a href="https://codepen.io/sdras/pen/YZBGNp/">Vue-controlled Wall-E</a> by Sarah Drasner (<a href="https://codepen.io/sdras">@sdras</a>) on <a href="https://codepen.io">CodePen</a>.</p>
553+
<script async src="https://production-assets.codepen.io/assets/embed/ei.js"></script>
554+
555+

0 commit comments

Comments
 (0)