knowyt/client/src/components/ReadySet.vue

140 lines
2.7 KiB
Vue
Raw Normal View History

2021-08-15 15:11:36 +00:00
fade-out<template>
2021-08-13 21:02:44 +00:00
<div class="ready-set">
2021-09-21 05:57:15 +00:00
<div :class="['ready-set__container', fadeOut ]">
2021-08-13 21:02:44 +00:00
<div class="ready-set__box1" />
2021-08-14 11:39:46 +00:00
<div class="ready-set__box2" />
<div class="ready-set__box3" />
2021-08-14 12:28:38 +00:00
<div
:class="['ready-set__text', 'ready-set__text__popup', textSize]"
:key="text"
>
{{ text }}
</div>
2021-08-13 21:02:44 +00:00
</div>
</div>
</template>
<script>
export default {
props: ['text'],
2021-08-14 12:28:38 +00:00
computed: {
2021-09-21 05:57:15 +00:00
fadeOut() {
2021-08-15 15:11:36 +00:00
if (this.text === '' ){
return 'ready-set__container__fade-out'
}
return
},
2021-08-14 12:28:38 +00:00
textSize() {
if (this.text.length < 3) {
return 'ready-set__text__size-big'
} else if (this.text.length < 5) {
return 'ready-set__text__size-medium'
2021-08-15 15:11:36 +00:00
} else if (this.text.length > 8) {
return 'ready-set__text__size-small'
2021-08-14 12:28:38 +00:00
}
},
},
2021-08-13 21:02:44 +00:00
}
</script>
<style lang="scss">
2021-11-28 16:24:22 +00:00
@import '~/assets/css/components';
2021-08-13 21:02:44 +00:00
.ready-set {
2021-09-21 05:57:15 +00:00
display: flex;
position: relative;
width: 100%;
height: 100%;
align-items: center;
justify-content: center;
2021-08-13 21:02:44 +00:00
&__container {
2021-09-21 05:57:15 +00:00
position: relative;
2021-08-13 21:02:44 +00:00
width: 600px;
height: 600px;
2021-08-14 12:39:16 +00:00
overflow: hidden;
2021-08-15 15:11:36 +00:00
&__fade-out {
animation: fade-out 0.3s linear;
animation-fill-mode: forwards;
}
2021-08-13 21:02:44 +00:00
}
&__box1 {
position: absolute;
left: 100px;
top: 100px;
transform: rotate(45deg);
width: 370px;
height: 370px;
2021-11-28 19:28:43 +00:00
background-color: $primary-box-background-color;
border: 15px solid $primary-box-border-color;
2021-08-13 21:02:44 +00:00
border-radius: 50px;
z-index: 5;
}
2021-08-14 11:39:46 +00:00
&__box2 {
position: absolute;
left: 90px;
top: 90px;
width: 420px;
height: 420px;
border-radius: 150px;
2021-11-28 19:28:43 +00:00
background-color: $primary-box-animation-color;
2021-08-14 11:39:46 +00:00
animation: spin-rev 5s linear infinite;
z-index: 4;
}
&__box3 {
position: absolute;
left: 90px;
top: 90px;
width: 420px;
height: 420px;
border-radius: 150px;
2021-11-28 19:28:43 +00:00
background-color: $primary-box-animation-color;
2021-08-14 11:39:46 +00:00
z-index: 3;
animation: spin 6s linear infinite;
}
2021-08-13 21:02:44 +00:00
&__text {
position: absolute;
width: 600px;
height: 600px;
line-height: 600px;
2021-08-15 15:11:36 +00:00
font-size: 100px;
2021-08-13 21:02:44 +00:00
font-family: 'Wendy One';
color: #ffff80;
text-align: center;
z-index: 10;
2021-08-14 12:28:38 +00:00
2021-08-15 15:11:36 +00:00
&__size-small {
font-size: 64px;
}
2021-08-14 12:28:38 +00:00
&__size-medium {
font-size: 150px;
}
&__size-big {
font-size: 250px;
}
&__popup {
animation: pop 0.5s ease-in-out;
}
2021-08-13 21:02:44 +00:00
}
}
2021-08-14 11:39:46 +00:00
@keyframes spin { 100% { transform: rotate(360deg); } }
@keyframes spin-rev { 100% { transform: rotate(-360deg); } }
2021-08-14 12:28:38 +00:00
@keyframes pop {
0% { transform: scale(1.7); }
25% { transform: scale(2); }
100% { transform: scale(1); }
}
2021-08-15 15:11:36 +00:00
@keyframes fade-out {
2021-09-05 19:30:13 +00:00
25% { transform: scale(1.2); }
2021-08-15 15:11:36 +00:00
100% { transform: scale(0); }
}
2021-08-13 21:02:44 +00:00
</style>