优化页面、修复BUG
This commit is contained in:
506
client/src/styles/pptPreview.css
Normal file
506
client/src/styles/pptPreview.css
Normal file
@@ -0,0 +1,506 @@
|
||||
/* PPT 预览幻灯片样式 */
|
||||
|
||||
.ppt-preview-root {
|
||||
--ppt-bg: #f8f7f4;
|
||||
--ppt-text: #1a1a1a;
|
||||
--ppt-muted: #666666;
|
||||
--ppt-accent: #c9a962;
|
||||
--ppt-code-bg: #1e1e1e;
|
||||
--ppt-code-text: #eeeeee;
|
||||
--ppt-border: rgba(0, 0, 0, 0.08);
|
||||
--ppt-chrome-h: 8.5rem;
|
||||
--ppt-ease-soft: cubic-bezier(0.22, 1, 0.36, 1);
|
||||
}
|
||||
|
||||
.ppt-preview-root.ppt-theme-dark {
|
||||
--ppt-bg: #141414;
|
||||
--ppt-text: #f5f5f5;
|
||||
--ppt-muted: #a0a0a0;
|
||||
--ppt-accent: #c9a962;
|
||||
--ppt-code-bg: #1e1e1e;
|
||||
--ppt-code-text: #eeeeee;
|
||||
--ppt-border: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
/* 舞台与缩放容器 */
|
||||
.ppt-stage {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
padding: 0.25rem 0;
|
||||
container-type: size;
|
||||
container-name: ppt-stage;
|
||||
}
|
||||
|
||||
.ppt-slide-scaler {
|
||||
width: min(100cqw, calc(100cqh * 16 / 9));
|
||||
aspect-ratio: 16 / 9;
|
||||
max-height: 100cqh;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 不支持 container query 时的回退 */
|
||||
@supports not (width: 1cqw) {
|
||||
.ppt-slide-scaler {
|
||||
width: min(100%, calc((100dvh - var(--ppt-chrome-h)) * 16 / 9));
|
||||
max-height: calc(100dvh - var(--ppt-chrome-h));
|
||||
}
|
||||
}
|
||||
|
||||
.ppt-slide-scaler .ppt-preview-root {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ppt-slide-scaler .ppt-slide-canvas {
|
||||
aspect-ratio: auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ppt-nav-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
z-index: 10;
|
||||
padding: 0.5rem;
|
||||
border-radius: 9999px;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
transition: color 0.15s, background 0.15s;
|
||||
}
|
||||
|
||||
.ppt-nav-btn:hover:not(:disabled) {
|
||||
color: #fff;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
}
|
||||
|
||||
.ppt-nav-btn:disabled {
|
||||
opacity: 0.2;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.ppt-nav-btn--prev {
|
||||
left: 0.75rem;
|
||||
}
|
||||
|
||||
.ppt-nav-btn--next {
|
||||
right: 0.75rem;
|
||||
}
|
||||
|
||||
.ppt-viewer--fullscreen .ppt-stage {
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.ppt-viewer--fullscreen .ppt-slide-scaler {
|
||||
width: 100vw;
|
||||
height: 100dvh;
|
||||
max-width: none;
|
||||
max-height: none;
|
||||
aspect-ratio: auto;
|
||||
}
|
||||
|
||||
.ppt-viewer--fullscreen .ppt-nav-btn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas {
|
||||
aspect-ratio: 16 / 9;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: var(--ppt-bg);
|
||||
color: var(--ppt-text);
|
||||
border: 1px solid var(--ppt-border);
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: clamp(1.25rem, 2.5vh, 2.5rem) clamp(1.25rem, 3vw, 2rem);
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
transition: padding 0.5s var(--ppt-ease-soft);
|
||||
}
|
||||
|
||||
.ppt-viewer--fullscreen .ppt-slide-canvas {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--title {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--focus-title {
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--focus-title .ppt-slide-section-header {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: clamp(1.25rem, 3vw, 2rem);
|
||||
right: clamp(1.25rem, 3vw, 2rem);
|
||||
transform: translateY(-50%);
|
||||
margin-bottom: 0;
|
||||
flex: 0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--focus-title .ppt-slide-section-title {
|
||||
font-size: clamp(1.5rem, 3.5vw, 2.5rem);
|
||||
text-align: center;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--has-content {
|
||||
justify-content: flex-start;
|
||||
}
|
||||
|
||||
.ppt-slide-section-header {
|
||||
flex-shrink: 0;
|
||||
margin-bottom: 1rem;
|
||||
transition:
|
||||
transform 0.5s var(--ppt-ease-soft),
|
||||
opacity 0.5s var(--ppt-ease-soft),
|
||||
margin 0.5s var(--ppt-ease-soft);
|
||||
}
|
||||
|
||||
.ppt-slide-section-header--top {
|
||||
position: relative;
|
||||
top: auto;
|
||||
left: auto;
|
||||
right: auto;
|
||||
transform: none;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.ppt-slide-section-header--top .ppt-slide-section-title {
|
||||
font-size: clamp(1.125rem, 2.2vw, 1.75rem);
|
||||
}
|
||||
|
||||
.ppt-slide-title-main {
|
||||
font-family: 'Playfair Display', Georgia, serif;
|
||||
font-size: clamp(1.5rem, 3.5vw, 2.75rem);
|
||||
font-weight: 700;
|
||||
line-height: 1.25;
|
||||
margin: 0 0 1.5rem;
|
||||
color: var(--ppt-text);
|
||||
}
|
||||
|
||||
.ppt-slide-title-meta {
|
||||
font-size: clamp(0.75rem, 1.5vw, 1rem);
|
||||
color: var(--ppt-muted);
|
||||
line-height: 1.8;
|
||||
}
|
||||
|
||||
.ppt-slide-section-title {
|
||||
font-size: clamp(1.125rem, 2.2vw, 1.75rem);
|
||||
font-weight: 700;
|
||||
margin: 0 0 0.5rem;
|
||||
color: var(--ppt-text);
|
||||
transition: font-size 0.5s var(--ppt-ease-soft);
|
||||
}
|
||||
|
||||
.ppt-slide-section-accent {
|
||||
width: 3rem;
|
||||
height: 0.2rem;
|
||||
background: var(--ppt-accent);
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.ppt-slide-body {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 0.75rem;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.ppt-block-reveal {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.ppt-block-reveal--hero {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.ppt-block-h1 {
|
||||
font-size: clamp(1.15rem, 2.4vw, 1.625rem);
|
||||
font-weight: 700;
|
||||
color: var(--ppt-text);
|
||||
margin: 0;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.ppt-block-h2 {
|
||||
font-size: clamp(1rem, 2vw, 1.375rem);
|
||||
font-weight: 700;
|
||||
color: var(--ppt-text);
|
||||
margin: 0;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.ppt-block-h3 {
|
||||
font-size: clamp(0.95rem, 1.6vw, 1.125rem);
|
||||
font-weight: 600;
|
||||
color: var(--ppt-text);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ppt-block-paragraph {
|
||||
font-size: clamp(0.8rem, 1.4vw, 1rem);
|
||||
line-height: 1.65;
|
||||
color: var(--ppt-text);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.ppt-block-image-wrap,
|
||||
.ppt-block-video-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 0;
|
||||
max-height: 45%;
|
||||
flex-shrink: 0;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ppt-block-video-wrap {
|
||||
min-height: 3rem;
|
||||
}
|
||||
|
||||
.ppt-block-image-wrap--hero,
|
||||
.ppt-block-video-wrap--hero {
|
||||
flex: 1;
|
||||
max-height: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ppt-block-image-wrap--hero .ppt-block-image,
|
||||
.ppt-block-video-wrap--hero .ppt-block-video {
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ppt-thumbnail .ppt-block-image-wrap,
|
||||
.ppt-thumbnail .ppt-block-video-wrap {
|
||||
max-height: 45%;
|
||||
}
|
||||
|
||||
.ppt-block-image,
|
||||
.ppt-block-video {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
width: 100%;
|
||||
object-fit: contain;
|
||||
border-radius: 0.375rem;
|
||||
background: #000;
|
||||
pointer-events: auto;
|
||||
}
|
||||
|
||||
.ppt-block-image-fallback {
|
||||
font-size: 0.875rem;
|
||||
color: var(--ppt-muted);
|
||||
font-style: italic;
|
||||
text-align: center;
|
||||
padding: 1rem;
|
||||
border: 1px dashed var(--ppt-border);
|
||||
border-radius: 0.375rem;
|
||||
}
|
||||
|
||||
.ppt-block-code {
|
||||
flex-shrink: 0;
|
||||
max-height: 40%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
border-radius: 0.5rem;
|
||||
overflow: hidden;
|
||||
background: var(--ppt-code-bg);
|
||||
}
|
||||
|
||||
.ppt-block-code-label {
|
||||
padding: 0.35rem 0.75rem;
|
||||
font-size: 0.65rem;
|
||||
font-family: ui-monospace, monospace;
|
||||
color: rgba(255, 255, 255, 0.4);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.05em;
|
||||
border-bottom: 1px solid rgba(255, 255, 255, 0.06);
|
||||
}
|
||||
|
||||
.ppt-block-code-content {
|
||||
margin: 0;
|
||||
padding: 0.75rem;
|
||||
font-size: clamp(0.65rem, 1.1vw, 0.8rem);
|
||||
font-family: 'JetBrains Mono', ui-monospace, monospace;
|
||||
color: var(--ppt-code-text);
|
||||
overflow: auto;
|
||||
white-space: pre;
|
||||
line-height: 1.5;
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.ppt-block-list {
|
||||
margin: 0;
|
||||
padding-left: 1.25rem;
|
||||
font-size: clamp(0.8rem, 1.4vw, 1rem);
|
||||
line-height: 1.6;
|
||||
color: var(--ppt-text);
|
||||
}
|
||||
|
||||
.ppt-block-list--ordered {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
|
||||
.ppt-block-placeholder {
|
||||
font-size: 0.875rem;
|
||||
color: var(--ppt-muted);
|
||||
font-style: italic;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
/* 内容块揭示动画 */
|
||||
.ppt-reveal-enter-active {
|
||||
transition: opacity 0.5s var(--ppt-ease-soft), transform 0.5s var(--ppt-ease-soft);
|
||||
}
|
||||
|
||||
.ppt-reveal-leave-active {
|
||||
transition: opacity 0.35s var(--ppt-ease-soft), transform 0.35s var(--ppt-ease-soft);
|
||||
}
|
||||
|
||||
.ppt-reveal-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateY(6px);
|
||||
}
|
||||
|
||||
.ppt-reveal-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateY(-4px);
|
||||
}
|
||||
|
||||
/* 幻灯片切换动画(crossfade 重叠) */
|
||||
.ppt-slide-enter-active,
|
||||
.ppt-slide-leave-active,
|
||||
.ppt-slide-back-enter-active,
|
||||
.ppt-slide-back-leave-active {
|
||||
transition: opacity 0.55s var(--ppt-ease-soft), transform 0.55s var(--ppt-ease-soft);
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.ppt-slide-leave-active,
|
||||
.ppt-slide-back-leave-active {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.ppt-slide-enter-active,
|
||||
.ppt-slide-back-enter-active {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.ppt-slide-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateX(8px) scale(0.985);
|
||||
}
|
||||
|
||||
.ppt-slide-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateX(-8px) scale(0.985);
|
||||
}
|
||||
|
||||
.ppt-slide-back-enter-from {
|
||||
opacity: 0;
|
||||
transform: translateX(-8px) scale(0.985);
|
||||
}
|
||||
|
||||
.ppt-slide-back-leave-to {
|
||||
opacity: 0;
|
||||
transform: translateX(8px) scale(0.985);
|
||||
}
|
||||
|
||||
.ppt-thumbnail {
|
||||
aspect-ratio: 16 / 9;
|
||||
width: 7rem;
|
||||
flex-shrink: 0;
|
||||
border-radius: 0.375rem;
|
||||
overflow: hidden;
|
||||
border: 2px solid transparent;
|
||||
cursor: pointer;
|
||||
opacity: 0.65;
|
||||
transition: opacity 0.15s, border-color 0.15s;
|
||||
background: var(--ppt-bg);
|
||||
}
|
||||
|
||||
.ppt-thumbnail:hover {
|
||||
opacity: 0.9;
|
||||
}
|
||||
|
||||
.ppt-thumbnail--active {
|
||||
opacity: 1;
|
||||
border-color: var(--ppt-accent);
|
||||
}
|
||||
|
||||
.ppt-thumbnail-inner {
|
||||
transform: scale(0.18);
|
||||
transform-origin: top left;
|
||||
width: 555%;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.ppt-reveal-enter-active,
|
||||
.ppt-reveal-leave-active,
|
||||
.ppt-slide-enter-active,
|
||||
.ppt-slide-leave-active,
|
||||
.ppt-slide-back-enter-active,
|
||||
.ppt-slide-back-leave-active,
|
||||
.ppt-slide-section-header,
|
||||
.ppt-slide-section-title,
|
||||
.ppt-slide-canvas {
|
||||
transition-duration: 0.01ms !important;
|
||||
}
|
||||
|
||||
.ppt-reveal-enter-from,
|
||||
.ppt-reveal-leave-to,
|
||||
.ppt-slide-enter-from,
|
||||
.ppt-slide-leave-to,
|
||||
.ppt-slide-back-enter-from,
|
||||
.ppt-slide-back-leave-to {
|
||||
transform: none;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 768px) {
|
||||
.ppt-stage {
|
||||
padding: 0.25rem 0;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas {
|
||||
padding: 1rem 1.25rem;
|
||||
}
|
||||
|
||||
.ppt-slide-canvas--focus-title .ppt-slide-section-header {
|
||||
left: 1.25rem;
|
||||
right: 1.25rem;
|
||||
}
|
||||
|
||||
.ppt-thumbnail {
|
||||
width: 5rem;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user