feat(short-drama-agent-front): 新增剧本骨架屏并优化阅读导出
This commit is contained in:
1 parent
54a381ebd3
commit
3cc65aa056
16 files changed
+792
-167
No files matched your search
@@ -0,0 +1,190 @@
|
||||
<script setup lang="ts">
|
||||
import { NSkeleton } from 'naive-ui'
|
||||
import WorkspacePage from '../../components/ui/WorkspacePage.vue'
|
||||
|
||||
/** 正文段落占位宽度;只描述排版,不推测实际剧集数量和内容。 */
|
||||
const paragraphs = [
|
||||
['100%', '96%', '100%', '92%', '62%'],
|
||||
['100%', '94%', '100%', '72%'],
|
||||
['96%', '100%', '92%', '100%', '56%']
|
||||
]
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<WorkspacePage
|
||||
split
|
||||
compact
|
||||
class="create-drama-skeleton"
|
||||
role="status"
|
||||
aria-label="正在读取剧本内容"
|
||||
aria-busy="true"
|
||||
>
|
||||
<template #header>
|
||||
<!-- 以下是创作阶段进度占位模块 -->
|
||||
<div class="drama-skeleton-stages" aria-hidden="true">
|
||||
<div v-for="stage in 5" :key="stage" class="drama-skeleton-stage">
|
||||
<NSkeleton circle :width="14" :height="14" />
|
||||
<NSkeleton :width="60" :height="11" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<div class="drama-skeleton-section" aria-hidden="true">
|
||||
<!-- 以下是剧本内容标签与导出按钮占位模块 -->
|
||||
<div class="drama-skeleton-tabs">
|
||||
<NSkeleton v-for="(width, tab) in [56, 56, 48, 56]" :key="tab" :width="width" :height="14" />
|
||||
<NSkeleton class="drama-skeleton-action" :width="40" :height="40" />
|
||||
</div>
|
||||
<div class="drama-skeleton-reader panel">
|
||||
<!-- 以下是剧集目录占位模块 -->
|
||||
<div class="drama-skeleton-directory">
|
||||
<div class="drama-skeleton-directory-heading">
|
||||
<NSkeleton :width="64" :height="14" />
|
||||
<NSkeleton :width="28" :height="11" />
|
||||
</div>
|
||||
<div v-for="episode in 5" :key="episode" class="drama-skeleton-episode">
|
||||
<NSkeleton class="drama-skeleton-episode-number" :height="13" />
|
||||
<NSkeleton
|
||||
class="drama-skeleton-episode-title"
|
||||
:width="episode % 2 ? '80%' : '64%'"
|
||||
:height="12"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 以下是剧集标题、摘要与正文占位模块 -->
|
||||
<div class="drama-skeleton-page">
|
||||
<div class="drama-skeleton-content">
|
||||
<div class="drama-skeleton-chapter-heading">
|
||||
<NSkeleton :width="60" :height="13" />
|
||||
<NSkeleton :width="'46%'" :height="28" />
|
||||
</div>
|
||||
<div class="drama-skeleton-summary">
|
||||
<NSkeleton :width="'94%'" :height="12" />
|
||||
<NSkeleton :width="'72%'" :height="12" />
|
||||
</div>
|
||||
<div v-for="(lines, paragraph) in paragraphs" :key="paragraph" class="drama-skeleton-paragraph">
|
||||
<NSkeleton v-for="(width, line) in lines" :key="line" :width="width" :height="14" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 以下是手机底部章节导航占位模块 -->
|
||||
<div class="drama-skeleton-mobile-navigation">
|
||||
<NSkeleton :width="44" :height="14" />
|
||||
<NSkeleton :width="80" :height="12" />
|
||||
<NSkeleton :width="64" :height="18" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</WorkspacePage>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
/* 骨架布局与剧本阅读器保持一致,颜色由 Naive UI 跟随当前主题。 */
|
||||
@reference "../../styles/styles.css";
|
||||
.drama-skeleton-stages {
|
||||
@apply flex items-center gap-7;
|
||||
}
|
||||
.drama-skeleton-stage {
|
||||
@apply flex shrink-0 items-center gap-[7px];
|
||||
}
|
||||
.drama-skeleton-section {
|
||||
@apply flex flex-col flex-1 min-h-0;
|
||||
}
|
||||
.drama-skeleton-tabs {
|
||||
@apply flex shrink-0 items-center gap-6 min-h-10;
|
||||
/* 骨架屏与真实标签栏共用上下模块间距。 */
|
||||
margin-bottom: var(--app-content-gap);
|
||||
}
|
||||
.drama-skeleton-action {
|
||||
/* 对齐方形导出图标按钮,右侧不添加额外留白。 */
|
||||
@apply ml-auto shrink-0;
|
||||
}
|
||||
.drama-skeleton-reader {
|
||||
@apply grid grid-cols-[clamp(190px,_22%,_240px)_minmax(0,_1fr)] flex-1 min-h-0 overflow-hidden;
|
||||
}
|
||||
.drama-skeleton-directory {
|
||||
@apply min-w-0 overflow-hidden bg-(--app-subtle);
|
||||
}
|
||||
:root:not([data-theme='dark']) .drama-skeleton-directory {
|
||||
/* 占位目录沿用正式导航的浅色底色,保留左右分栏层次。 */
|
||||
@apply bg-(--app-control);
|
||||
}
|
||||
:root:not([data-theme='dark']) .drama-skeleton-directory :deep(.n-skeleton) {
|
||||
/* 导航底色加深后,浅色占位条仍需清晰可见。 */
|
||||
--n-color-start: var(--app-border) !important;
|
||||
--n-color-end: var(--app-field-hover) !important;
|
||||
}
|
||||
.drama-skeleton-directory-heading {
|
||||
/* 占位标题与剧集条目使用同一左侧对齐线。 */
|
||||
@apply flex items-center justify-between gap-2 pt-[22px] px-3.5 pb-3.5;
|
||||
}
|
||||
.drama-skeleton-episode {
|
||||
@apply flex flex-col justify-center gap-2 min-h-16 py-3 px-3.5 mb-1.5;
|
||||
}
|
||||
.drama-skeleton-episode-number {
|
||||
@apply w-12;
|
||||
}
|
||||
.drama-skeleton-page {
|
||||
@apply min-w-0 overflow-hidden;
|
||||
}
|
||||
:root:not([data-theme='dark']) .drama-skeleton-page {
|
||||
/* 浅色占位区域沿用正文底色,加载完成时保持背景一致。 */
|
||||
@apply bg-(--app-subtle);
|
||||
}
|
||||
.drama-skeleton-mobile-navigation {
|
||||
display: none;
|
||||
}
|
||||
.drama-skeleton-content {
|
||||
@apply p-8 max-w-[900px];
|
||||
}
|
||||
.drama-skeleton-chapter-heading {
|
||||
@apply flex flex-col gap-3 pt-3.5 pb-[18px] mb-6;
|
||||
}
|
||||
.drama-skeleton-summary {
|
||||
@apply flex flex-col gap-3 pt-[17px] pb-[22px] mb-[23px];
|
||||
}
|
||||
.drama-skeleton-paragraph {
|
||||
@apply flex flex-col gap-4 mb-7;
|
||||
}
|
||||
@media (max-width: 1000px) {
|
||||
.drama-skeleton-reader {
|
||||
@apply grid-cols-[180px_minmax(0,_1fr)];
|
||||
}
|
||||
}
|
||||
@media (max-width: 800px) {
|
||||
.drama-skeleton-reader {
|
||||
@apply flex flex-col;
|
||||
}
|
||||
.drama-skeleton-directory {
|
||||
@apply hidden;
|
||||
}
|
||||
.drama-skeleton-page {
|
||||
@apply flex-1 min-h-0;
|
||||
}
|
||||
.drama-skeleton-mobile-navigation {
|
||||
@apply flex items-center justify-between min-h-11 shrink-0 px-3 bg-(--app-subtle);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
.drama-skeleton-content {
|
||||
@apply px-[18px] py-3;
|
||||
}
|
||||
.drama-skeleton-chapter-heading {
|
||||
@apply gap-1 py-2 mb-3;
|
||||
}
|
||||
.drama-skeleton-summary {
|
||||
@apply pt-0 pb-4 mb-4;
|
||||
}
|
||||
.drama-skeleton-tabs {
|
||||
@apply gap-3;
|
||||
}
|
||||
}
|
||||
@media (max-width: 760px) {
|
||||
.create-drama-skeleton :deep(.workspace-heading-scroll) {
|
||||
@apply hidden;
|
||||
}
|
||||
}
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.create-drama-skeleton :deep(.n-skeleton) {
|
||||
animation: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in new issue
Block a user