1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-12-23 19:18:44 +09:00
MisskeyIO/packages/client/src/components/global/loading.vue

83 lines
1.2 KiB
Vue
Raw Normal View History

<template>
<div class="yxspomdl" :class="{ inline, colored, mini }">
2020-02-10 20:44:59 +09:00
<div class="ring"></div>
</div>
</template>
<script lang="ts" setup>
import { } from 'vue';
const props = withDefaults(defineProps<{
inline?: boolean;
colored?: boolean;
mini?: boolean;
}>(), {
inline: false,
colored: true,
mini: false,
});
</script>
<style lang="scss" scoped>
2020-02-10 20:44:59 +09:00
@keyframes ring {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
.yxspomdl {
padding: 32px;
text-align: center;
2021-04-16 23:04:25 +09:00
cursor: wait;
--size: 48px;
2021-04-16 23:04:25 +09:00
&.colored {
color: var(--accent);
}
2020-02-12 02:52:37 +09:00
&.inline {
display: inline;
padding: 0;
--size: 32px;
}
2020-02-12 02:52:37 +09:00
&.mini {
padding: 16px;
--size: 32px;
2020-02-12 02:52:37 +09:00
}
2020-02-10 20:44:59 +09:00
> .ring {
2021-04-16 23:04:25 +09:00
position: relative;
2020-02-10 20:44:59 +09:00
display: inline-block;
2020-02-12 02:35:03 +09:00
vertical-align: middle;
2020-02-10 20:44:59 +09:00
2021-04-16 23:04:25 +09:00
&:before,
&:after {
content: " ";
display: block;
box-sizing: border-box;
width: var(--size);
height: var(--size);
2021-04-16 23:04:25 +09:00
border-radius: 50%;
border: solid 4px;
}
&:before {
border-color: currentColor;
opacity: 0.3;
}
&:after {
position: absolute;
top: 0;
border-color: currentColor transparent transparent transparent;
animation: ring 0.5s linear infinite;
}
}
}
</style>