You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* update state examples, remove one
* compose components
* Update src/guide/transitions-state.md
Co-authored-by: Ben Hong <[email protected]>
* Update src/guide/transitions-state.md
Co-authored-by: Ben Hong <[email protected]>
Co-authored-by: Ben Hong <[email protected]>
When you update the number, the change is animated below the input. This makes for a nice demo, but what about something that isn't directly stored as a number, like any valid CSS color for example? Here's how we could accomplish this with [Tween.js](https://github.com/tweenjs/tween.js) and [Color.js](https://github.com/brehaut/color-js):
When you update the number, the change is animated below the input.
136
56
137
57
## Dynamic State Transitions
138
58
139
59
As with Vue's transition components, the data backing state transitions can be updated in real time, which is especially useful for prototyping! Even using a simple SVG polygon, you can achieve many effects that would be difficult to conceive of until you've played with the variables a little.
140
60
141
-
TODO: put in example
142
-
143
-
See [this example](https://codesandbox.io/s/github/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-dynamic-state-transitions) for the complete code behind the above demo.
Managing many state transitions can quickly increase the complexity of a Vue instance or component. Fortunately, many animations can be extracted out into dedicated child components. Let's do this with the animated integer from our earlier example:
Now we can compose multiple states with these child components. It's exciting- 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.
229
149
230
-
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.
150
+
You can see how we could use this for data visualization, for physics effects, for character animations and interactions, the sky's the limit.
231
151
232
152
## Bringing Designs to Life
233
153
@@ -237,5 +157,5 @@ Vue can help. Since SVGs are just data, we only need examples of what these crea
237
157
238
158
Sarah Drasner demonstrates this in the demo below, using a combination of timed and interactivity-driven state changes:
239
159
240
-
<pdata-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 <ahref="https://codepen.io/sdras/pen/YZBGNp/">Vue-controlled Wall-E</a> by Sarah Drasner (<ahref="https://codepen.io/sdras">@sdras</a>) on <ahref="https://codepen.io">CodePen</a>.</p>
160
+
<pdata-height="400"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 <ahref="https://codepen.io/sdras/pen/YZBGNp/">Vue-controlled Wall-E</a> by Sarah Drasner (<ahref="https://codepen.io/sdras">@sdras</a>) on <ahref="https://codepen.io">CodePen</a>.</p>
0 commit comments