- Vue.js 2 Web Development Projects
- Guillaume Chau
- 68字
- 2021-07-02 22:34:35
The overlay animation
Like we did with the hand, we will use a transition to animate the overlay.
- Add a transition called "zoom" around the overlay component:
<transition name="zoom">
<overlay v-if="activeOverlay">
<component :is="'overlay-content-' + activeOverlay"
:player="currentPlayer" :opponent="currentOpponent"
:players="players" />
</overlay>
</transition>
- Add the following CSS rules in the transition.css file:
.zoom-enter-active,
.zoom-leave-active {
transition: opacity .3s, transform .3s;
}
.zoom-enter,
.zoom-leave-to {
opacity: 0;
transform: scale(.7);
}
This is a simple animation that will zoom out the overlay while fading it out.
推薦閱讀
- NativeScript for Angular Mobile Development
- 數(shù)據(jù)結(jié)構(gòu)習(xí)題精解(C語(yǔ)言實(shí)現(xiàn)+微課視頻)
- Mastering C# Concurrency
- Java 11 Cookbook
- Gradle for Android
- Serverless computing in Azure with .NET
- Python深度學(xué)習(xí)原理、算法與案例
- Java Web開(kāi)發(fā)就該這樣學(xué)
- Geospatial Development By Example with Python
- Python青少年趣味編程
- Drupal 8 Development Cookbook(Second Edition)
- 關(guān)系數(shù)據(jù)庫(kù)與SQL Server 2012(第3版)
- Spring Boot從入門(mén)到實(shí)戰(zhàn)
- Java編程指南:語(yǔ)法基礎(chǔ)、面向?qū)ο蟆⒑瘮?shù)式編程與項(xiàng)目實(shí)戰(zhàn)
- Scala編程(第4版)