2023-10-03 01:29:20 +08:00
|
|
|
<script lang="ts">
|
2023-10-04 21:50:19 +08:00
|
|
|
export let layout = "bubble";
|
2023-10-03 01:29:20 +08:00
|
|
|
</script>
|
|
|
|
|
2023-10-04 21:50:19 +08:00
|
|
|
<div
|
|
|
|
class="message pending"
|
|
|
|
role="status"
|
|
|
|
aria-label="Loading response"
|
|
|
|
aria-live="polite"
|
|
|
|
style:border-radius={layout === "bubble" ? "var(--radius-xxl)" : "none"}
|
|
|
|
>
|
|
|
|
<span class="sr-only">Loading content</span>
|
|
|
|
<div class="dot-flashing" />
|
|
|
|
|
|
|
|
<div class="dot-flashing" />
|
|
|
|
|
|
|
|
<div class="dot-flashing" />
|
|
|
|
</div>
|
2023-10-03 01:29:20 +08:00
|
|
|
|
|
|
|
<style>
|
|
|
|
.pending {
|
2023-11-14 09:12:56 +08:00
|
|
|
background: var(--color-accent-soft);
|
2023-10-03 01:29:20 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
justify-content: center;
|
|
|
|
align-items: center;
|
|
|
|
align-self: center;
|
|
|
|
gap: 2px;
|
2023-10-04 21:50:19 +08:00
|
|
|
width: 100%;
|
2023-11-14 09:12:56 +08:00
|
|
|
height: var(--size-16);
|
2023-10-03 01:29:20 +08:00
|
|
|
}
|
|
|
|
.dot-flashing {
|
2023-11-14 09:12:56 +08:00
|
|
|
animation: flash 1s infinite ease-in-out;
|
2023-10-03 01:29:20 +08:00
|
|
|
border-radius: 5px;
|
|
|
|
background-color: var(--body-text-color);
|
2023-11-14 09:12:56 +08:00
|
|
|
width: 7px;
|
|
|
|
height: 7px;
|
2023-10-03 01:29:20 +08:00
|
|
|
color: var(--body-text-color);
|
|
|
|
}
|
2023-11-14 09:12:56 +08:00
|
|
|
@keyframes flash {
|
|
|
|
0%,
|
|
|
|
100% {
|
|
|
|
opacity: 0;
|
|
|
|
}
|
|
|
|
50% {
|
|
|
|
opacity: 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.dot-flashing:nth-child(1) {
|
|
|
|
animation-delay: 0s;
|
|
|
|
}
|
|
|
|
|
2023-10-03 01:29:20 +08:00
|
|
|
.dot-flashing:nth-child(2) {
|
|
|
|
animation-delay: 0.33s;
|
|
|
|
}
|
|
|
|
.dot-flashing:nth-child(3) {
|
|
|
|
animation-delay: 0.66s;
|
|
|
|
}
|
|
|
|
</style>
|