ReadySet animation

This commit is contained in:
Settel 2021-08-15 17:11:36 +02:00
parent 6a7a1cea57
commit ae4d5fdb8f

View File

@ -1,6 +1,6 @@
<template> fade-out<template>
<div class="ready-set"> <div class="ready-set">
<div class="ready-set__container"> <div :class="['ready-set__container', flipOut ]">
<div class="ready-set__box1" /> <div class="ready-set__box1" />
<div class="ready-set__box2" /> <div class="ready-set__box2" />
<div class="ready-set__box3" /> <div class="ready-set__box3" />
@ -18,11 +18,19 @@
export default { export default {
props: ['text'], props: ['text'],
computed: { computed: {
flipOut() {
if (this.text === '' ){
return 'ready-set__container__fade-out'
}
return
},
textSize() { textSize() {
if (this.text.length < 3) { if (this.text.length < 3) {
return 'ready-set__text__size-big' return 'ready-set__text__size-big'
} else if (this.text.length < 5) { } else if (this.text.length < 5) {
return 'ready-set__text__size-medium' return 'ready-set__text__size-medium'
} else if (this.text.length > 8) {
return 'ready-set__text__size-small'
} }
}, },
}, },
@ -39,6 +47,11 @@ export default {
width: 600px; width: 600px;
height: 600px; height: 600px;
overflow: hidden; overflow: hidden;
&__fade-out {
animation: fade-out 0.3s linear;
animation-fill-mode: forwards;
}
} }
&__box1 { &__box1 {
@ -83,12 +96,16 @@ export default {
width: 600px; width: 600px;
height: 600px; height: 600px;
line-height: 600px; line-height: 600px;
font-size: 64px; font-size: 100px;
font-family: 'Wendy One'; font-family: 'Wendy One';
color: #ffff80; color: #ffff80;
text-align: center; text-align: center;
z-index: 10; z-index: 10;
&__size-small {
font-size: 64px;
}
&__size-medium { &__size-medium {
font-size: 150px; font-size: 150px;
} }
@ -109,4 +126,8 @@ export default {
25% { transform: scale(2); } 25% { transform: scale(2); }
100% { transform: scale(1); } 100% { transform: scale(1); }
} }
@keyframes fade-out {
25% { transform: scale(1.2); }
100% { transform: scale(0); }
}
</style> </style>