mirror of
https://github.com/HangarMC/Hangar.git
synced 2024-11-21 01:21:54 +08:00
feat: make skeletons rounded, only display them after 400ms (#1402)
This commit is contained in:
parent
bedd81159c
commit
2fd7b2348b
@ -7,10 +7,19 @@ withDefaults(
|
||||
animated: true,
|
||||
}
|
||||
);
|
||||
|
||||
const show = ref(false);
|
||||
if (import.meta.client) {
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
show.value = true;
|
||||
}, 400);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="skeleton" :class="animated && 'skeleton--animated'">
|
||||
<div v-show="show" class="skeleton rounded-md shadow-md" :class="animated && 'skeleton--animated'">
|
||||
<div class="skeleton__content">Loading...</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -92,7 +92,10 @@ function getVisibilityTitle(visibility: Visibility) {
|
||||
<div ref="pageChangeScrollAnchor" class="flex flex-wrap md:flex-nowrap gap-4">
|
||||
<section class="basis-full md:basis-11/15 flex-grow">
|
||||
<ul>
|
||||
<Skeleton v-if="versionsStatus === 'loading'" class="h-100" />
|
||||
<template v-if="versionsStatus === 'loading'">
|
||||
<Skeleton class="mb-2 h-[90px]" />
|
||||
<Skeleton class="mb-2 h-[90px]" />
|
||||
</template>
|
||||
<Alert v-else-if="!versions?.result?.length" type="info"> {{ i18n.t("version.page.noVersions") }} </Alert>
|
||||
<Pagination
|
||||
v-else
|
||||
|
Loading…
Reference in New Issue
Block a user