Files
short-drama-agent-front/src/features/subject-identity/components/IdentityDetailSkeleton.vue
T

126 lines
4.4 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<script setup lang="ts">
import { NSkeleton } from 'naive-ui'
/** 身份详情占位选项。 */
interface Props {
/** 是否显示未知主体的标题与刷新操作占位。 */
heading?: boolean
}
/** 完整工作区未知主体名称时显示标题占位,切换主体时保留真实名称。 */
withDefaults(defineProps<Props>(), { heading: false })
/** 占位高度对应身份描述与核心提示词的最低编辑高度。 */
const fieldHeights = [80, 96]
</script>
<template>
<!-- 以下是主体身份步骤、编辑器、参考图操作与形态入口占位模块 -->
<div class="identity-detail-skeleton" role="status" aria-label="正在读取主体身份内容" aria-busy="true">
<div v-if="heading" class="identity-skeleton-row identity-skeleton-heading">
<NSkeleton :width="120" :height="16" />
<NSkeleton :width="56" :height="12" />
</div>
<div class="identity-skeleton-steps">
<div v-for="step in 3" :key="step" class="identity-skeleton-row">
<NSkeleton circle :width="20" :height="20" />
<NSkeleton :width="88" :height="12" />
</div>
</div>
<div class="identity-skeleton-row identity-skeleton-next">
<div class="identity-skeleton-copy">
<NSkeleton :width="170" :height="14" />
<NSkeleton :width="'min(260px, 100%)'" :height="12" />
</div>
</div>
<div v-for="height in fieldHeights" :key="height" class="identity-skeleton-field">
<NSkeleton :width="70" :height="12" />
<NSkeleton :height="height" />
</div>
<div class="identity-skeleton-row">
<NSkeleton :width="16" :height="16" />
<NSkeleton :width="96" :height="12" />
</div>
<div class="identity-skeleton-row identity-skeleton-save">
<NSkeleton :width="96" :height="34" />
<NSkeleton :width="126" :height="34" />
</div>
<div class="identity-skeleton-row identity-skeleton-gallery-heading">
<NSkeleton :width="100" :height="14" />
<NSkeleton :width="76" :height="24" />
</div>
<!-- 以下是母版卡片与底部候选操作占位模块,主页面不再显示候选缩略图列表 -->
<div class="identity-skeleton-anchor">
<NSkeleton class="identity-skeleton-picture" />
<NSkeleton :width="'80%'" :height="18" />
<NSkeleton :width="'60%'" :height="12" />
<NSkeleton :height="34" />
</div>
<div class="identity-skeleton-row identity-skeleton-save">
<NSkeleton :width="110" :height="34" />
<NSkeleton :width="126" :height="34" />
</div>
<div class="identity-skeleton-field">
<NSkeleton :width="85" :height="12" />
<div class="identity-skeleton-row">
<NSkeleton :width="70" :height="24" />
<NSkeleton :width="80" :height="24" />
</div>
</div>
</div>
</template>
<style scoped>
@reference "../../../styles/styles.css";
.identity-detail-skeleton {
@apply flex flex-col min-w-0 gap-5;
}
.identity-skeleton-row {
@apply flex min-w-0 items-center gap-3;
}
.identity-skeleton-row :deep(.n-skeleton) {
@apply shrink-0 max-w-full;
}
.identity-skeleton-heading,
.identity-skeleton-gallery-heading,
.identity-skeleton-next {
@apply justify-between flex-wrap;
}
.identity-skeleton-steps {
@apply flex flex-wrap gap-x-6 gap-y-2;
}
.identity-skeleton-copy,
.identity-skeleton-field {
@apply flex flex-col min-w-0 gap-3;
}
/* 骨架母版尺寸与正式卡片一致,手机仍按内容宽度显示正方形。 */
.identity-skeleton-anchor {
@apply grid w-full max-w-[260px] gap-3;
}
.identity-skeleton-anchor .identity-skeleton-picture {
@apply aspect-square;
height: auto;
}
.identity-skeleton-save {
@apply flex-wrap;
}
.identity-detail-skeleton :deep(.n-skeleton) {
--n-color-start: var(--app-border) !important;
--n-color-end: var(--app-field-hover) !important;
}
@media (max-width: 760px) {
.identity-skeleton-anchor {
@apply max-w-none;
}
.identity-skeleton-next {
@apply items-start flex-col;
}
.identity-skeleton-save > :deep(.n-skeleton) {
width: 100% !important;
}
}
@media (prefers-reduced-motion: reduce) {
.identity-detail-skeleton :deep(.n-skeleton) {
animation: none;
}
}
</style>