mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 21:07:27 +00:00
feat: better loading in match details
This commit is contained in:
parent
ccf79aad50
commit
8db630389a
3 changed files with 92 additions and 1 deletions
86
client/src/components/Common/CubeLoader.vue
Normal file
86
client/src/components/Common/CubeLoader.vue
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
<template>
|
||||||
|
<div
|
||||||
|
:style="{ width: size, height: size, margin }"
|
||||||
|
class="relative"
|
||||||
|
style="transform: rotateZ(45deg);"
|
||||||
|
>
|
||||||
|
<div class="relative float-left w-1/2 cube-1 cube h-1/2"></div>
|
||||||
|
<div class="relative float-left w-1/2 cube-2 cube h-1/2"></div>
|
||||||
|
<div class="relative float-left w-1/2 cube-4 cube h-1/2"></div>
|
||||||
|
<div class="relative float-left w-1/2 cube-3 cube h-1/2"></div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
color: {
|
||||||
|
type: String,
|
||||||
|
default: '#bee3f8'
|
||||||
|
},
|
||||||
|
size: {
|
||||||
|
type: String,
|
||||||
|
default: '30px'
|
||||||
|
},
|
||||||
|
margin: {
|
||||||
|
type: String,
|
||||||
|
default: '0 auto'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.cube {
|
||||||
|
transform: scale(1.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube:before {
|
||||||
|
content: "";
|
||||||
|
@apply absolute top-0 left-0 w-full h-full bg-blue-300;
|
||||||
|
animation: cubeAngle 2.4s infinite linear both;
|
||||||
|
transform-origin: 100% 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-2 {
|
||||||
|
transform: scale(1.1) rotateZ(90deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-3 {
|
||||||
|
transform: scale(1.1) rotateZ(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-4 {
|
||||||
|
transform: scale(1.1) rotateZ(270deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-2:before {
|
||||||
|
animation-delay: 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-3:before {
|
||||||
|
animation-delay: 0.6s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cube-4:before {
|
||||||
|
animation-delay: 0.9s;
|
||||||
|
}
|
||||||
|
|
||||||
|
@keyframes cubeAngle {
|
||||||
|
0%,
|
||||||
|
10% {
|
||||||
|
@apply opacity-0;
|
||||||
|
transform: perspective(130px) rotateX(-180deg);
|
||||||
|
}
|
||||||
|
25%,
|
||||||
|
75% {
|
||||||
|
@apply opacity-100;
|
||||||
|
transform: perspective(130px) rotateX(0deg);
|
||||||
|
}
|
||||||
|
90%,
|
||||||
|
100% {
|
||||||
|
@apply opacity-0;
|
||||||
|
transform: perspective(130px) rotateY(180deg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -26,19 +26,23 @@
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="data.status === 'loading' && detailsOpen">
|
<div v-else-if="data.status === 'loading' && detailsOpen">
|
||||||
<p class="py-5 text-lg font-semibold text-blue-100 bg-blue-800">Loading...</p>
|
<div class="py-5 bg-blue-800 rounded-b-lg">
|
||||||
|
<CubeLoader />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</transition>
|
</transition>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapActions, mapState } from 'vuex'
|
import { mapActions, mapState } from 'vuex'
|
||||||
|
import CubeLoader from '@/components/Common/CubeLoader.vue'
|
||||||
import DetailedMatchGlobalStats from '@/components/Match/DetailedMatchGlobalStats.vue'
|
import DetailedMatchGlobalStats from '@/components/Match/DetailedMatchGlobalStats.vue'
|
||||||
import DetailedMatchTeam from '@/components/Match/DetailedMatchTeam.vue'
|
import DetailedMatchTeam from '@/components/Match/DetailedMatchTeam.vue'
|
||||||
import SwitchToggle from '@/components/Form/SwitchToggle.vue'
|
import SwitchToggle from '@/components/Form/SwitchToggle.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
CubeLoader,
|
||||||
DetailedMatchGlobalStats,
|
DetailedMatchGlobalStats,
|
||||||
DetailedMatchTeam,
|
DetailedMatchTeam,
|
||||||
SwitchToggle,
|
SwitchToggle,
|
||||||
|
|
|
||||||
|
|
@ -293,6 +293,7 @@ module.exports = {
|
||||||
full: '100%',
|
full: '100%',
|
||||||
screen: '100vh',
|
screen: '100vh',
|
||||||
'200': '50rem',
|
'200': '50rem',
|
||||||
|
'1/2': '50%',
|
||||||
}),
|
}),
|
||||||
inset: {
|
inset: {
|
||||||
'0': '0',
|
'0': '0',
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue