Web: Style spinner

Forked from supahfunk's https://codepen.io/supah/pen/BjYLdW
This commit is contained in:
Pablo Vazquez 2022-05-04 19:29:27 +02:00
parent 60df6e33dc
commit 79397a4ed3
2 changed files with 71 additions and 4 deletions

View File

@ -8,8 +8,8 @@
<li><a href="/">Settings</a></li> <li><a href="/">Settings</a></li>
</ul> </ul>
</nav> </nav>
<span class="app-version">
<api-spinner /> <api-spinner />
<span class="app-version">
version: {{ flamencoVersion }} version: {{ flamencoVersion }}
</span> </span>
</header> </header>

View File

@ -1,5 +1,9 @@
<template> <template>
<span class="api-spinner" :class="{ running: apiQueryCount.num > 0 }">&#128008;</span> <span class="api-spinner" :class="{ running: apiQueryCount.num > 0 }">
<svg class="spinner" viewBox="0 0 50 50">
<circle class="path" cx="25" cy="25" r="20" fill="none" stroke-width="5"></circle>
</svg>
</span>
</template> </template>
<script> <script>
@ -16,8 +20,71 @@ export default {
span { span {
visibility: hidden; visibility: hidden;
opacity: 0; opacity: 0;
transition-delay: 100ms; transition-delay: 250ms;
transition-duration: 300ms; transition-duration: 500ms;
font-weight: bold;
margin-right: 2rem;
position: relative;
}
.spinner {
-webkit-animation: rotate 2s linear infinite;
animation: rotate 2s linear infinite;
z-index: 2;
position: absolute;
top: 50%;
left: 50%;
margin: -10px 0 0 -10px;
width: 20px;
height: 20px;
}
.spinner .path {
stroke: var(--color-text-hint);
stroke-linecap: round;
-webkit-animation: dash 1.5s ease-in-out infinite;
animation: dash 1.5s ease-in-out infinite;
}
@-webkit-keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@keyframes rotate {
100% {
transform: rotate(360deg);
}
}
@-webkit-keyframes dash {
0% {
stroke-dasharray: 1, 150;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -35;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -124;
}
}
@keyframes dash {
0% {
stroke-dasharray: 1, 150;
stroke-dashoffset: 0;
}
50% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -35;
}
100% {
stroke-dasharray: 90, 150;
stroke-dashoffset: -124;
}
} }
span.running { span.running {