Skip to content

CanvasAnvil is an open source AI diagram maker and flowchart generator - an infinite-canvas diagram editor and self-hosted drawio alternative that writes editable .drawio files. Text to diagram, then fix nodes, layout and labels in place. Also AI presentations, interior design CAD/BOM, posters and infographics.

feat(ui): carry the palette into the PPT views and the shared chat layer

codingFeng1014c2f99a1acbd
diff --git a/client/shared/chat/chat-input.tsx b/client/shared/chat/chat-input.tsx
index 51d8412..4e46675 100644
--- a/client/shared/chat/chat-input.tsx
+++ b/client/shared/chat/chat-input.tsx
@@ -194,12 +194,12 @@ export function ChatInput({
el.setAttribute("data-token-kind", segment.tokenKind);
el.setAttribute("contenteditable", "false");
el.className = isOutline
- ? "inline-flex items-center gap-1.5 rounded-full border border-blue-200 bg-blue-50 px-2 py-0.5 text-xs font-medium text-blue-700 dark:border-blue-400/30 dark:bg-blue-950/40 dark:text-blue-200 align-middle"
- : "inline-flex items-center gap-1.5 rounded-full border border-red-200 bg-red-50 px-2 py-0.5 text-xs font-medium text-red-700 dark:border-red-400/30 dark:bg-red-950/40 dark:text-red-200 align-middle";
+ ? "inline-flex items-center gap-1.5 rounded-full border border-primary/30 bg-primary/[0.08] px-2 py-0.5 text-xs font-medium text-primary align-middle"
+ : "inline-flex items-center gap-1.5 rounded-full border border-destructive/25 bg-destructive/[0.08] px-2 py-0.5 text-xs font-medium text-destructive align-middle";
const icon = document.createElement("span");
icon.className = isOutline
- ? "inline-flex h-4 w-4 items-center justify-center rounded-full bg-blue-600 text-[10px] font-semibold text-white"
- : "inline-flex h-4 w-4 items-center justify-center rounded-full bg-red-600 text-[10px] font-semibold text-white";
+ ? "inline-flex h-4 w-4 items-center justify-center rounded-full bg-primary text-[10px] font-semibold text-primary-foreground"
+ : "inline-flex h-4 w-4 items-center justify-center rounded-full bg-destructive text-[10px] font-semibold text-destructive-foreground";
icon.textContent = isOutline ? "T" : "P";
const text = document.createElement("span");
text.textContent = segment.label;
@@ -394,7 +394,7 @@ export function ChatInput({
return (
<div
- className="relative rounded-2xl border border-border bg-background shadow-sm focus-within:ring-2 focus-within:ring-primary/20 focus-within:border-primary/50 transition-all duration-200"
+ className="relative rounded-2xl border border-border bg-card shadow-soft focus-within:ring-[3px] focus-within:ring-ring/25 focus-within:border-ring focus-within:shadow-soft-lg transition-[border-color,box-shadow] duration-base ease-out-soft"
onDragOver={(e) => e.preventDefault()}
onDrop={handleDrop}
>
@@ -576,7 +576,7 @@ export function ChatInput({
variant="ghost"
size="sm"
onClick={onClearChat}
- className="h-8 w-8 p-0 text-muted-foreground hover:text-destructive hover:bg-destructive/10"
+ className="h-8 w-8 p-0 text-muted-foreground transition-[color,background-color,transform] duration-fast ease-out-soft hover:text-destructive hover:bg-destructive/10 active:scale-90"
>
<Trash2 className="h-4 w-4" />
</ButtonWithTooltip>
@@ -591,7 +591,7 @@ export function ChatInput({
size="sm"
onClick={onToggleHistory}
disabled={historyDisabled}
- className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
+ className="h-8 w-8 p-0 text-muted-foreground transition-[color,background-color,transform] duration-fast ease-out-soft hover:text-foreground active:scale-90"
>
<History className="h-4 w-4" />
</ButtonWithTooltip>
@@ -603,7 +603,7 @@ export function ChatInput({
variant="ghost"
size="sm"
onClick={handleImageUpload}
- className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
+ className="h-8 w-8 p-0 text-muted-foreground transition-[color,background-color,transform] duration-fast ease-out-soft hover:text-foreground active:scale-90"
>
<ImageIcon className="h-4 w-4" />
</ButtonWithTooltip>
@@ -615,7 +615,7 @@ export function ChatInput({
variant="ghost"
size="sm"
onClick={handleFileUpload}
- className="h-8 w-8 p-0 text-muted-foreground hover:text-foreground"
+ className="h-8 w-8 p-0 text-muted-foreground transition-[color,background-color,transform] duration-fast ease-out-soft hover:text-foreground active:scale-90"
>
<FileText className="h-4 w-4" />
</ButtonWithTooltip>
@@ -653,8 +653,8 @@ export function ChatInput({
variant="default"
size="sm"
className={cn(
- "h-8 w-8 p-0 rounded-xl shadow-sm",
- (!hasText && !hasFiles) ? "opacity-60" : ""
+ "h-8 w-8 p-0 rounded-xl shadow-xs transition-[transform,opacity,background-color] duration-fast ease-out-soft active:scale-90",
+ (!hasText && !hasFiles) ? "opacity-50" : ""
)}
aria-label={t(uiLang, "chat.send")}
>
diff --git a/client/shared/chat/file-preview-list.tsx b/client/shared/chat/file-preview-list.tsx
index 139bf66..267e0c8 100644
--- a/client/shared/chat/file-preview-list.tsx
+++ b/client/shared/chat/file-preview-list.tsx
@@ -121,11 +121,11 @@ export function FilePreviewList({
) : (
<>
{pdfInfo?.isExtracting ? (
- <Loader2 className="h-5 w-5 text-blue-500 animate-spin" />
+ <Loader2 className="h-5 w-5 text-primary animate-spin" />
) : isPdf ? (
- <FileText className="h-5 w-5 text-red-500" />
+ <FileText className="h-5 w-5 text-destructive" />
) : (
- <FileCode className="h-5 w-5 text-blue-500" />
+ <FileCode className="h-5 w-5 text-primary" />
)}
</>
)}
@@ -161,7 +161,7 @@ export function FilePreviewList({
onClick={() => setSelectedImage(null)}
>
<button
- className="absolute top-4 right-4 z-10 bg-white rounded-full p-2 hover:bg-gray-200 transition-colors"
+ className="absolute top-4 right-4 z-10 bg-white text-black rounded-full p-2 hover:bg-white/85 transition-colors"
onClick={() => setSelectedImage(null)}
aria-label={trText("关闭", "Close")}
>
diff --git a/client/shared/chat/history-dialog.tsx b/client/shared/chat/history-dialog.tsx
index 7da8100..4c0c96f 100644
--- a/client/shared/chat/history-dialog.tsx
+++ b/client/shared/chat/history-dialog.tsx
@@ -74,7 +74,7 @@ export function HistoryDialog({
<div key={item.id} className="p-3 rounded-lg border border-border/50 bg-muted/20 hover:bg-muted/40 transition-colors flex items-center justify-between group">
<div className="flex flex-col gap-1 overflow-hidden">
<div className="flex items-center gap-2 text-sm font-medium">
- <span className="w-6 h-6 rounded-full bg-blue-100 dark:bg-blue-900/30 text-blue-600 flex items-center justify-center text-xs">
+ <span className="w-6 h-6 rounded-full bg-primary/12 text-primary flex items-center justify-center text-xs">
{history.length - index}
</span>
<span>{formatDate(item.timestamp)}</span>
diff --git a/client/shared/chat/shimmer.tsx b/client/shared/chat/shimmer.tsx
index 95460ba..23e2f84 100644
--- a/client/shared/chat/shimmer.tsx
+++ b/client/shared/chat/shimmer.tsx
@@ -1,4 +1,4 @@
-import { motion } from "motion/react"
+import { motion, useReducedMotion } from "motion/react"
import {
type CSSProperties,
type ElementType,
@@ -16,6 +16,16 @@ export type TextShimmerProps = {
spread?: number
}
+/**
+ * A travelling highlight for text that is still being produced.
+ *
+ * The colours come from the project's own tokens. The previous version
+ * referenced `--color-background` / `--color-muted-foreground`, which Tailwind
+ * only generates in v4; against this v3 build both resolved to nothing, so the
+ * whole `background-image` was invalid and the element -- which is
+ * `color: transparent` by design -- rendered as blank space. "Thinking..." was
+ * literally invisible the entire time it was on screen.
+ */
const ShimmerComponent = ({
children,
as: Component = "p",
@@ -23,8 +33,13 @@ const ShimmerComponent = ({
duration = 2,
spread = 2,
}: TextShimmerProps) => {
- const MotionComponent = motion.create(
- Component as keyof JSX.IntrinsicElements,
+ const reduceMotion = useReducedMotion()
+
+ // Recreating this on every render would hand React a new component type
+ // each time and remount the subtree.
+ const MotionComponent = useMemo(
+ () => motion.create(Component as keyof JSX.IntrinsicElements),
+ [Component],
)
const dynamicSpread = useMemo(
@@ -34,10 +49,11 @@ const ShimmerComponent = ({
return (
<MotionComponent
- animate={{ backgroundPosition: "0% center" }}
+ animate={reduceMotion ? undefined : { backgroundPosition: "0% center" }}
className={cn(
"relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
- "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
+ "[--shimmer-base:hsl(var(--muted-foreground))] [--shimmer-peak:hsl(var(--foreground))]",
+ "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--shimmer-peak),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
className,
)}
initial={{ backgroundPosition: "100% center" }}
@@ -45,14 +61,18 @@ const ShimmerComponent = ({
{
"--spread": `${dynamicSpread}px`,
backgroundImage:
- "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))",
+ "var(--bg), linear-gradient(var(--shimmer-base), var(--shimmer-base))",
} as CSSProperties
}
- transition={{
- repeat: Number.POSITIVE_INFINITY,
- duration,
- ease: "linear",
- }}
+ transition={
+ reduceMotion
+ ? undefined
+ : {
+ repeat: Number.POSITIVE_INFINITY,
+ duration,
+ ease: "linear",
+ }
+ }
>
{children}
</MotionComponent>
diff --git a/client/workspaces/ppt/canvas/views/CreationStart.tsx b/client/workspaces/ppt/canvas/views/CreationStart.tsx
index 800a426..ef8146b 100644
--- a/client/workspaces/ppt/canvas/views/CreationStart.tsx
+++ b/client/workspaces/ppt/canvas/views/CreationStart.tsx
@@ -1,4 +1,5 @@
import { motion } from "motion/react";
+import { SPRING } from "@/shared/motion";
import { FileText, Lightbulb, Loader2, Presentation, Sparkles, Upload, X } from "lucide-react";
import { Button } from "@/shared/ui/button";
import { Dialog, DialogContent, DialogHeader, DialogTitle } from "@/shared/ui/dialog";
@@ -74,23 +75,23 @@ export function CreationStart({
return (
- <div className="w-full h-full bg-zinc-50/50 dark:bg-zinc-900 flex flex-col overflow-hidden">
+ <div className="w-full h-full bg-sunken/50 flex flex-col overflow-hidden">
<div className="flex-1 overflow-auto p-8">
- <div className="max-w-4xl mx-auto space-y-8 bg-white dark:bg-zinc-800 p-8 rounded-2xl shadow-sm border border-zinc-100 dark:border-zinc-700/50">
+ <div className="max-w-4xl mx-auto space-y-8 bg-card p-8 rounded-2xl shadow-soft border border-border/60">
<div className="space-y-8">
{/* Template Selection */}
{creationMode !== "image_transform" ? (
<div className="space-y-4">
- <label className="text-sm font-semibold text-zinc-900 dark:text-zinc-100 flex items-center gap-2">
- <span className="w-6 h-6 rounded-full bg-blue-100 text-blue-600 text-xs flex items-center justify-center font-bold">1</span>
+ <label className="text-sm font-semibold text-foreground flex items-center gap-2">
+ <span className="w-6 h-6 rounded-full bg-primary/12 text-primary text-xs flex items-center justify-center font-bold">1</span>
{tr("选择或上传参考模板", "Choose or upload a reference template")}
</label>
<div className="grid gap-4 grid-cols-[repeat(auto-fill,minmax(180px,1fr))]">
- <label className="cursor-pointer border-2 border-dashed rounded-xl transition-all duration-200 overflow-hidden relative aspect-video flex flex-col items-center justify-center group border-zinc-200 dark:border-zinc-700 hover:border-blue-500 hover:bg-blue-50/30 dark:hover:bg-zinc-800/50">
- <div className="flex flex-col items-center text-zinc-400 group-hover:text-blue-500 transition-colors">
- <div className="w-10 h-10 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-2 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 transition-colors">
+ <label className="cursor-pointer border-2 border-dashed rounded-xl transition-all duration-200 overflow-hidden relative aspect-video flex flex-col items-center justify-center group border-border hover:border-primary hover:bg-primary/[0.08]">
+ <div className="flex flex-col items-center text-muted-foreground/70 group-hover:text-primary transition-colors">
+ <div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-2 group-hover:bg-primary/12 transition-colors">
<Upload className="w-5 h-5" />
</div>
<span className="text-xs font-medium">{tr("添加模板", "Add template")}</span>
@@ -101,28 +102,29 @@ export function CreationStart({
type="button"
onClick={() => templateLibrary.generator.setOpen(true)}
title={tr("AI生成模板", "AI generate template")}
- className="cursor-pointer border-2 border-dashed rounded-xl transition-all duration-200 overflow-hidden relative aspect-video flex flex-col items-center justify-center group border-zinc-200 dark:border-zinc-700 hover:border-blue-500 hover:bg-blue-50/30 dark:hover:bg-zinc-800/50"
+ className="cursor-pointer border-2 border-dashed rounded-xl transition-all duration-200 overflow-hidden relative aspect-video flex flex-col items-center justify-center group border-border hover:border-primary hover:bg-primary/[0.08]"
>
- <div className="flex flex-col items-center text-zinc-400 group-hover:text-blue-500 transition-colors">
- <div className="w-10 h-10 rounded-full bg-zinc-100 dark:bg-zinc-800 flex items-center justify-center mb-2 group-hover:bg-blue-100 dark:group-hover:bg-blue-900/30 transition-colors">
+ <div className="flex flex-col items-center text-muted-foreground/70 group-hover:text-primary transition-colors">
+ <div className="w-10 h-10 rounded-full bg-muted flex items-center justify-center mb-2 group-hover:bg-primary/12 transition-colors">
<Sparkles className="w-5 h-5" />
</div>
<span className="text-xs font-medium">{tr("AI生成模板", "AI generate")}</span>
</div>
</button>
- {templateLibrary.templates.map((t) => (
+ {templateLibrary.templates.map((t, i) => (
<div
key={t.id}
onClick={() => void templateLibrary.selectTemplate(t)}
- className={`cursor-pointer border rounded-xl overflow-hidden relative aspect-video group transition-all duration-200 bg-zinc-100 dark:bg-zinc-900 ${
+ style={{ animationDelay: `${Math.min(i, 8) * 40}ms` }}
+ className={`animate-rise-in cursor-pointer border rounded-xl overflow-hidden relative aspect-video group transition-all duration-base ease-out-soft bg-muted ${
templateLibrary.selectedTemplateId === t.id
- ? "border-blue-500 ring-2 ring-blue-500 shadow-md"
- : "border-zinc-200 dark:border-zinc-700 hover:ring-2 hover:ring-blue-500 hover:shadow-md"
+ ? "border-primary ring-2 ring-primary shadow-md"
+ : "border-border hover:ring-2 hover:ring-primary hover:shadow-md"
}`}
>
<img src={t.previewSrc} className="w-full h-full object-cover transition-transform duration-500 group-hover:scale-105" alt={t.name} />
{templateLibrary.selectedTemplateId === t.id && (
- <div className="absolute top-2 left-2 rounded-full bg-blue-600 px-2 py-0.5 text-[10px] font-medium text-white shadow">
+ <div className="absolute top-2 left-2 rounded-full bg-primary px-2 py-0.5 text-[10px] font-medium text-primary-foreground shadow-xs">
{tr("已选择", "Selected")}
</div>
)}
@@ -148,13 +150,13 @@ export function CreationStart({
{/* Mode Selection & Input */}
<div className="space-y-4">
- <label className="text-sm font-semibold text-zinc-900 dark:text-zinc-100 flex items-center gap-2">
- <span className="w-6 h-6 rounded-full bg-blue-100 text-blue-600 text-xs flex items-center justify-center font-bold">{creationMode === "image_transform" ? "1" : "2"}</span>
+ <label className="text-sm font-semibold text-foreground flex items-center gap-2">
+ <span className="w-6 h-6 rounded-full bg-primary/12 text-primary text-xs flex items-center justify-center font-bold">{creationMode === "image_transform" ? "1" : "2"}</span>
{tr("输入内容", "Input")}
</label>
{/* Segmented Control */}
- <div className="bg-zinc-100 dark:bg-zinc-900/50 p-1 rounded-lg inline-flex w-full sm:w-auto">
+ <div className="bg-muted p-1 rounded-lg inline-flex w-full sm:w-auto">
{tabs.map((tab) => (
<button
key={tab.id}
@@ -162,15 +164,15 @@ export function CreationStart({
title={tab.label}
className={`relative flex-1 sm:flex-none px-6 py-2 text-sm font-medium rounded-md transition-all duration-200 ${
creationMode === tab.id
- ? "text-zinc-900 dark:text-zinc-100 shadow-sm"
- : "text-zinc-500 hover:text-zinc-700 dark:text-zinc-400 dark:hover:text-zinc-200"
+ ? "text-foreground shadow-sm"
+ : "text-muted-foreground hover:text-foreground"
}`}
>
{creationMode === tab.id && (
<motion.div
layoutId="activeTab"
- className="absolute inset-0 bg-white dark:bg-zinc-700 rounded-md"
- transition={{ type: "spring", stiffness: 500, damping: 30 }}
+ className="absolute inset-0 bg-card rounded-md shadow-xs"
+ transition={SPRING.snap}
/>
)}
<span className="relative z-10">{tab.label}</span>
@@ -195,8 +197,8 @@ export function CreationStart({
transition={{ duration: 0.2 }}
className="space-y-3"
>
- <div className="flex items-center gap-2 text-sm text-zinc-700 dark:text-zinc-200">
- {creationMode === "beautify" ? <Sparkles className="w-4 h-4 text-blue-600" /> : creationMode === "image_transform" ? <Presentation className="w-4 h-4 text-blue-600" /> : <Lightbulb className="w-4 h-4 text-amber-500" />}
+ <div className="flex items-center gap-2 text-sm text-foreground/80">
+ {creationMode === "beautify" ? <Sparkles className="w-4 h-4 text-primary" /> : creationMode === "image_transform" ? <Presentation className="w-4 h-4 text-primary" /> : <Lightbulb className="w-4 h-4 text-primary" />}
<span>{modeCopy.hint}</span>
</div>
@@ -210,10 +212,10 @@ export function CreationStart({
onChange={inputs.beautify.onInputChange}
/>
- <div className="flex items-center justify-between gap-3 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 px-4 py-3">
+ <div className="flex items-center justify-between gap-3 rounded-xl border border-border bg-sunken px-4 py-3">
<div className="min-w-0">
- <div className="text-sm font-medium text-zinc-900 dark:text-zinc-100">{tr("上传 PDF", "Upload PDF")}</div>
- <div className="text-xs text-zinc-500 dark:text-zinc-400 truncate">
+ <div className="text-sm font-medium text-foreground">{tr("上传 PDF", "Upload PDF")}</div>
+ <div className="text-xs text-muted-foreground truncate">
{inputs.beautify.file ? inputs.beautify.file.name : tr("未选择文件", "No file selected")}
</div>
</div>
@@ -228,10 +230,10 @@ export function CreationStart({
</Button>
</div>
- <label className="flex items-center justify-between gap-3 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 px-4 py-3 cursor-pointer">
+ <label className="flex items-center justify-between gap-3 rounded-xl border border-border bg-sunken px-4 py-3 cursor-pointer">
<div className="min-w-0">
- <div className="text-sm font-medium text-zinc-900 dark:text-zinc-100">{tr("启用模板美化(可选)", "Use template for beautify (optional)")}</div>
- <div className="text-xs text-zinc-500 dark:text-zinc-400">
+ <div className="text-sm font-medium text-foreground">{tr("启用模板美化(可选)", "Use template for beautify (optional)")}</div>
+ <div className="text-xs text-muted-foreground">
{tr("开启后将把当前模板传给美化模型;关闭则仅基于上传的幻灯片美化。", "When enabled, current template is passed to beautify model; otherwise beautify uses only uploaded slides.")}
</div>
</div>
@@ -239,14 +241,14 @@ export function CreationStart({
type="checkbox"
checked={inputs.beautify.useTemplate}
onChange={(e) => inputs.beautify.setUseTemplate(e.target.checked)}
- className="h-4 w-4 rounded border-zinc-300 text-blue-600 focus:ring-blue-500"
+ className="h-4 w-4 rounded border-input text-primary focus:ring-ring"
/>
</label>
<textarea
value={inputs.beautify.requirement}
onChange={(e) => inputs.beautify.setRequirement(e.target.value)}
- className="w-full h-36 p-4 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all resize-none outline-none"
+ className="w-full h-36 p-4 rounded-xl border border-border bg-sunken text-sm focus:ring-2 focus:ring-ring/30 focus:border-ring transition-all resize-none outline-none"
placeholder={modeCopy.placeholder}
/>
</div>
@@ -260,10 +262,10 @@ export function CreationStart({
onChange={inputs.imageTransform.onInputChange}
/>
- <div className="flex items-center justify-between gap-3 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 px-4 py-3">
+ <div className="flex items-center justify-between gap-3 rounded-xl border border-border bg-sunken px-4 py-3">
<div className="min-w-0">
- <div className="text-sm font-medium text-zinc-900 dark:text-zinc-100">{tr("上传 PDF", "Upload PDF")}</div>
- <div className="text-xs text-zinc-500 dark:text-zinc-400 truncate">
+ <div className="text-sm font-medium text-foreground">{tr("上传 PDF", "Upload PDF")}</div>
+ <div className="text-xs text-muted-foreground truncate">
{inputs.imageTransform.file ? inputs.imageTransform.file.name : tr("未选择文件", "No file selected")}
</div>
</div>
@@ -278,7 +280,7 @@ export function CreationStart({
</Button>
</div>
- <div className="rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 px-4 py-3 text-xs text-zinc-500 dark:text-zinc-400 leading-6">
+ <div className="rounded-xl border border-border bg-sunken px-4 py-3 text-xs text-muted-foreground leading-6">
<div>{tr("处理结果:", "Output:")}</div>
<div>{tr("系统会把 PDF 每一页导入为图片幻灯片。", "The system imports each PDF page as an image slide.")}</div>
<div>{tr("如需可编辑文字,请在导出可编辑 PPTX 时再进行文字识别与回填。", "If you need editable text, recognition and text refill happen only during editable PPTX export.")}</div>
@@ -294,7 +296,7 @@ export function CreationStart({
if (creationMode === "idea") inputs.setIdeaInput(v);
else inputs.setOutlineInput(v);
}}
- className="w-full h-40 p-4 pb-12 rounded-xl border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/50 text-sm focus:ring-2 focus:ring-blue-500/20 focus:border-blue-500 transition-all resize-none outline-none"
+ className="w-full h-40 p-4 pb-12 rounded-xl border border-border bg-sunken text-sm focus:ring-2 focus:ring-ring/30 focus:border-ring transition-all resize-none outline-none"
placeholder={modeCopy.placeholder}
/>
<button
@@ -302,7 +304,7 @@ export function CreationStart({
onClick={() => inputs.reference.inputRef.current?.click()}
disabled={inputs.reference.isParsing}
title={tr("上传参考文件", "Upload reference files")}
- className="absolute bottom-3 right-3 inline-flex items-center gap-2 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-white/80 dark:bg-zinc-900/60 px-3 py-1.5 text-xs text-zinc-700 dark:text-zinc-200 shadow-sm hover:bg-white dark:hover:bg-zinc-900 transition-colors disabled:opacity-60"
+ className="absolute bottom-3 right-3 inline-flex items-center gap-2 rounded-lg border border-border bg-card/80 px-3 py-1.5 text-xs text-foreground/80 shadow-xs hover:bg-card transition-colors disabled:opacity-60"
>
{inputs.reference.isParsing ? <Loader2 className="w-3.5 h-3.5 animate-spin" /> : <Upload className="w-3.5 h-3.5" />}
{tr("上传文件", "Upload files")}
@@ -310,7 +312,7 @@ export function CreationStart({
</div>
<div className="flex items-center justify-between gap-3">
- <div className="text-xs text-zinc-500 dark:text-zinc-400">
+ <div className="text-xs text-muted-foreground">
{tr(
"上传 PDF/Word/LaTeX/TXT作为参考资料(可选);推荐 Word/LaTeX,图表素材更稳定。",
"Upload PDF/Word/LaTeX/TXT as reference (optional); Word/LaTeX recommended for stable figures."
@@ -321,7 +323,7 @@ export function CreationStart({
type="button"
onClick={() => inputs.reference.setUploadFiles([])}
title={tr("清空参考文件", "Clear reference files")}
- className="text-xs text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"
+ className="text-xs text-muted-foreground hover:text-foreground"
disabled={inputs.reference.isParsing}
>
{tr("清空", "Clear")}
@@ -332,20 +334,20 @@ export function CreationStart({
{inputs.reference.files.length > 0 && (
<div className="grid gap-2">
{inputs.reference.files.map((f) => (
- <div key={f.id} className="flex items-center justify-between gap-3 rounded-lg border border-zinc-200 dark:border-zinc-700 bg-zinc-50 dark:bg-zinc-900/40 px-3 py-2">
+ <div key={f.id} className="flex items-center justify-between gap-3 rounded-lg border border-border bg-sunken px-3 py-2">
<button
type="button"
onClick={() => inputs.reference.openPreview(f)}
title={tr("预览文件", "Preview file")}
className="flex items-center gap-2 min-w-0 text-left"
>
- <FileText className="w-4 h-4 text-zinc-500 flex-shrink-0" />
- <span className="truncate text-sm text-zinc-800 dark:text-zinc-100">{f.filename}</span>
- <span className="text-xs text-zinc-500 dark:text-zinc-400 flex-shrink-0">({f.charCount} chars)</span>
+ <FileText className="w-4 h-4 text-muted-foreground flex-shrink-0" />
+ <span className="truncate text-sm text-foreground/90">{f.filename}</span>
+ <span className="text-xs text-muted-foreground flex-shrink-0">({f.charCount} chars)</span>
</button>
<button
type="button"
- className="text-xs text-zinc-500 hover:text-zinc-800 dark:hover:text-zinc-200"
+ className="text-xs text-muted-foreground hover:text-foreground"
title={tr("移除文件", "Remove file")}
onClick={() => {
const nextFiles = inputs.reference.uploadFiles.filter((rf) => rf.name !== f.filename);
@@ -366,7 +368,11 @@ export function CreationStart({
<Button
onClick={creationMode === "beautify" ? onStartBeautify : creationMode === "image_transform" ? onStartImageTransform : creationMode === "idea" ? onGenerateOutline : onLoadOutline}
disabled={Boolean(progress.message) || (creationMode === "beautify" ? !inputs.beautify.file : creationMode === "image_transform" ? !inputs.imageTransform.file || !isPdfFile(inputs.imageTransform.file) : inputs.reference.isParsing || (creationMode === "idea" ? !inputs.ideaInput.trim() : !inputs.outlineInput.trim()))}
- className="w-full py-6 text-lg font-medium bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-700 hover:to-indigo-700 text-white shadow-lg shadow-blue-500/20 rounded-xl transition-all hover:scale-[1.01] active:scale-[0.99]"
+ size="lg"
+ // The blue-to-indigo gradient was the loudest element on
+ // the screen; the solid variant carries the same weight
+ // without introducing a second hue.
+ className="w-full h-auto py-5 text-base font-medium rounded-xl shadow-soft hover:shadow-soft-lg"
>
{progress.message ? <Loader2 className="w-5 h-5 mr-2 animate-spin" /> : <Sparkles className="w-5 h-5 mr-2" />}
{progress.message || (creationMode === "beautify" ? tr("开始渲染", "Start rendering") : creationMode === "image_transform" ? tr("开始转化", "Start transform") : creationMode === "idea" ? tr("开始生成大纲", "Generate outline") : tr("载入大纲", "Load outline"))}
@@ -388,7 +394,7 @@ export function CreationStart({
<DialogTitle>{tr("AI生成模板", "AI Template Generator")}</DialogTitle>
</DialogHeader>
<div className="space-y-4">
- <div className="text-xs text-zinc-500 dark:text-zinc-400">
+ <div className="text-xs text-muted-foreground">
{tr("生成的模板会自动加入模板列表,可随时删除。", "Generated templateLibrary.templates will be added to the template list automatically and can be deleted anytime.")}
</div>
<Textarea
@@ -414,7 +420,7 @@ export function CreationStart({
type="button"
onClick={templateLibrary.generator.generate}
disabled={templateLibrary.generator.isGenerating || !templateLibrary.generator.requirement.trim()}
- className="bg-blue-600 hover:bg-blue-700"
+ className="bg-primary hover:bg-primary/90"
>
{templateLibrary.generator.isGenerating ? (
<>
diff --git a/client/workspaces/ppt/canvas/views/DeckView.tsx b/client/workspaces/ppt/canvas/views/DeckView.tsx
index a68c9d6..0277654 100644
--- a/client/workspaces/ppt/canvas/views/DeckView.tsx
+++ b/client/workspaces/ppt/canvas/views/DeckView.tsx
@@ -146,16 +146,16 @@ export function DeckView({
);
};
return (
- <div className="w-full h-full bg-zinc-100 dark:bg-zinc-900 flex flex-col">
+ <div className="w-full h-full bg-muted flex flex-col">
{/* Toolbar */}
- <div className="relative z-50 h-14 px-4 bg-white dark:bg-zinc-800 border-b border-zinc-200 dark:border-zinc-700 flex justify-between items-center shadow-sm">
+ <div className="relative z-50 h-14 px-4 bg-card border-b border-border flex justify-between items-center shadow-sm">
<div className="flex items-center gap-4 [&>h2]:hidden">
<h2 className="hidden font-semibold text-sm text-foreground">{tr("PPT 演示文稿", "PPT Deck")}</h2>
<div className="font-semibold text-sm text-foreground">{tr("PPT \u6f14\u793a\u6587\u7a3f", "PPT Deck")}</div>
<button
onClick={actions.backToStart}
title={tr("返回开始", "Back to start")}
- className="flex items-center gap-2 px-3 py-1.5 bg-zinc-100 dark:bg-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-600 text-xs rounded transition-colors shadow-sm"
+ className="flex items-center gap-2 px-3 py-1.5 bg-muted hover:bg-accent text-xs rounded transition-colors shadow-sm"
>
<ArrowLeft className="w-3.5 h-3.5" />
<span>{tr("返回", "Back")}</span>
@@ -166,7 +166,7 @@ export function DeckView({
onClick={() => slideshow.open(deck.currentIndex)}
disabled={deck.slides.length === 0}
title={tr("从当前页开始放映", "Present from the current slide")}
- className="flex items-center gap-2 px-3 py-1.5 bg-zinc-100 dark:bg-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-600 text-foreground rounded-md text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
+ className="flex items-center gap-2 px-3 py-1.5 bg-muted hover:bg-accent text-foreground rounded-md text-xs font-medium transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
>
<Presentation className="w-3.5 h-3.5" />
<span>{tr("放映", "Present")}</span>
@@ -176,7 +176,7 @@ export function DeckView({
onClick={() => exporter.setMenuOpen((open) => !open)}
disabled={deck.slides.length === 0 || !!exporter.isExporting}
title={tr("导出", "Export")}
- className="flex items-center gap-2 px-3 py-1.5 bg-zinc-100 dark:bg-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-600 text-xs rounded transition-colors shadow-sm disabled:opacity-60"
+ className="flex items-center gap-2 px-3 py-1.5 bg-muted hover:bg-accent text-xs rounded transition-colors shadow-sm disabled:opacity-60"
>
{exporter.isExporting ? <Loader2 className="w-3.5 h-3.5 animate-spin" /> : <Download className="w-3.5 h-3.5" />}
<span>{exporter.isExporting ? tr("导出中…", "Exporting...") : tr("导出", "Export")}</span>
@@ -186,11 +186,11 @@ export function DeckView({
initial={{ opacity: 0, y: -6 }}
animate={{ opacity: 1, y: 0 }}
transition={{ duration: 0.16, ease: "easeOut" }}
- className="absolute left-0 top-full z-[70] mt-2 min-w-[190px] rounded-xl border border-zinc-200 bg-white p-2 shadow-xl dark:border-zinc-700 dark:bg-zinc-800"
+ className="absolute left-0 top-full z-[70] mt-2 min-w-[190px] rounded-xl border border-border bg-popover p-2 shadow-soft-lg"
>
<button
type="button"
- className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-zinc-700 transition-colors hover:bg-zinc-100 dark:text-zinc-100 dark:hover:bg-zinc-700"
+ className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-foreground/80 transition-colors hover:bg-accent"
onClick={() => {
exporter.setMenuOpen(false);
void actions.downloadPdf();
@@ -200,7 +200,7 @@ export function DeckView({
</button>
<button
type="button"
- className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-zinc-700 transition-colors hover:bg-zinc-100 dark:text-zinc-100 dark:hover:bg-zinc-700"
+ className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-foreground/80 transition-colors hover:bg-accent"
onClick={() => {
exporter.setMenuOpen(false);
void actions.downloadPpt();
@@ -210,7 +210,7 @@ export function DeckView({
</button>
<button
type="button"
- className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-zinc-700 transition-colors hover:bg-zinc-100 dark:text-zinc-100 dark:hover:bg-zinc-700"
+ className="flex w-full items-center rounded-lg px-3 py-2 text-left text-xs text-foreground/80 transition-colors hover:bg-accent"
onClick={() => {
exporter.setMenuOpen(false);
void actions.downloadEditablePpt();
@@ -226,22 +226,22 @@ export function DeckView({
onClick={actions.retryFailedBeautify}
disabled={status.failedBeautifyCount === 0 || Boolean(progress.message)}
title={tr("重试失败页", "Retry failed slides")}
- className="flex items-center gap-2 px-3 py-1.5 bg-zinc-100 dark:bg-zinc-700 hover:bg-zinc-200 dark:hover:bg-zinc-600 text-xs rounded transition-colors shadow-sm disabled:opacity-60"
+ className="flex items-center gap-2 px-3 py-1.5 bg-muted hover:bg-accent text-xs rounded transition-colors shadow-sm disabled:opacity-60"
>
<Sparkles className="w-3.5 h-3.5" />
<span>{tr("重试失败页", "Retry failed")}</span>
- {status.failedBeautifyCount > 0 ? <span className="rounded bg-red-100 px-1.5 py-0.5 text-[10px] text-red-700">{status.failedBeautifyCount}</span> : null}
+ {status.failedBeautifyCount > 0 ? <span className="rounded bg-destructive/12 px-1.5 py-0.5 text-[10px] text-destructive">{status.failedBeautifyCount}</span> : null}
</button>
)}
</div>
<div className="flex items-center gap-3 text-xs text-muted-foreground">
{creationMode === "beautify" && status.failedBeautifyCount > 0 ? (
- <span className="rounded border border-red-200 bg-red-50 px-2 py-1 text-red-700">
+ <span className="rounded border border-destructive/25 bg-destructive/[0.08] px-2 py-1 text-destructive">
{tr(`失败 ${status.failedBeautifyCount} 页`, `${status.failedBeautifyCount} failed`)}
</span>
) : null}
{creationMode === "image_transform" && status.failedImageTransformCount > 0 ? (
- <span className="rounded border border-red-200 bg-red-50 px-2 py-1 text-red-700">
+ <span className="rounded border border-destructive/25 bg-destructive/[0.08] px-2 py-1 text-destructive">
{tr(`转化失败 ${status.failedImageTransformCount} 页`, `${status.failedImageTransformCount} failed`)}
</span>
) : null}
@@ -252,7 +252,7 @@ export function DeckView({
{/* Main View */}
<div className="flex-1 flex overflow-hidden">
{/* Thumbnails */}
- <div className="w-64 bg-zinc-50 dark:bg-zinc-900 border-r border-border overflow-y-auto p-4 space-y-4">
+ <div className="w-64 bg-sunken border-r border-border overflow-y-auto p-4 space-y-4">
{deck.slides.map((slide, index) => {
const hasGeneratedImage = deck.getBackgroundUrl(slide.id);
const slideFailure = creationMode === "image_transform" ? inputs.imageTransform.failures[slide.id] : inputs.beautify.failures[slide.id];
@@ -261,10 +261,11 @@ export function DeckView({
<ContextMenuTrigger asChild>
<div
onClick={() => deck.setCurrentIndex(index)}
- className={`cursor-pointer border-2 rounded-lg overflow-hidden relative aspect-[16/9] group transition-all duration-200 ${
- deck.currentIndex === index
- ? 'border-blue-600 shadow-md scale-[1.02]'
- : 'border-transparent hover:border-zinc-300 dark:hover:border-zinc-700 bg-white dark:bg-zinc-800 shadow-sm'
+ style={{ animationDelay: `${Math.min(index, 8) * 35}ms` }}
+ className={`animate-rise-in cursor-pointer border-2 rounded-lg overflow-hidden relative aspect-[16/9] group transition-[border-color,box-shadow,transform] duration-base ease-out-soft ${
+ deck.currentIndex === index
+ ? 'border-primary shadow-soft scale-[1.02]'
+ : 'border-transparent hover:border-border hover:-translate-y-0.5 bg-card shadow-xs'
}`}
>
{creationMode !== "image_transform" ? (
@@ -287,14 +288,14 @@ export function DeckView({
{hasGeneratedImage ? (
renderScaledSlideScene(slide, false, 240, 135)
) : (
- <div className="w-full h-full p-2 flex flex-col bg-white overflow-hidden text-[6px]">
+ <div className="w-full h-full p-2 flex flex-col bg-white text-[#141413] overflow-hidden text-[6px]">
{deck.templateImage && (
<img src={deck.templateImage} className="absolute inset-0 w-full h-full object-cover opacity-20 pointer-events-none" alt="" />
)}
<div className="font-bold mb-1 truncate z-10 relative">{slide.title}</div>
<div className="flex-1 space-y-0.5 z-10 relative">
{(slide.content || []).slice(0, 3).map((line, i) => (
- <div key={i} className="truncate text-zinc-500">• {line}</div>
+ <div key={i} className="truncate text-[#5B5751]">• {line}</div>
))}
</div>
</div>
@@ -305,7 +306,7 @@ export function DeckView({
</div>
{slideFailure ? (
<div
- className="absolute top-1 right-1 bg-red-600/90 text-white text-[10px] px-1.5 py-0.5 rounded-sm max-w-[85%] truncate"
+ className="absolute top-1 right-1 bg-destructive/90 text-destructive-foreground text-[10px] px-1.5 py-0.5 rounded-sm max-w-[85%] truncate"
title={slideFailure}
>
{creationMode === "image_transform" ? tr("转化失败", "Transform failed") : tr("美化失败", "Beautify failed")}
@@ -339,8 +340,8 @@ export function DeckView({
</div>
{/* Preview */}
- <div className="flex-1 p-4 flex items-center justify-center bg-zinc-200/50 dark:bg-zinc-950/50 overflow-auto relative">
- <div className="absolute top-4 left-4 z-30 flex items-center gap-2 bg-white/80 dark:bg-zinc-900/70 backdrop-blur rounded-xl border border-border/50 px-3 py-2 shadow-sm">
+ <div className="flex-1 p-4 flex items-center justify-center bg-accent/50 overflow-auto relative">
+ <div className="absolute top-4 left-4 z-30 flex items-center gap-2 bg-card/80 backdrop-blur rounded-xl border border-border/50 px-3 py-2 shadow-sm">
<Button
size="sm"
className="h-7 px-2 text-xs"
@@ -375,7 +376,7 @@ export function DeckView({
)}
</div>
{status.currentSlideFailure ? (
- <div className="absolute top-16 left-4 z-30 max-w-[520px] rounded-lg border border-red-200 bg-red-50/95 px-3 py-2 text-xs text-red-700 shadow-sm">
+ <div className="absolute top-16 left-4 z-30 max-w-[520px] rounded-lg border border-destructive/25 bg-destructive/[0.08] px-3 py-2 text-xs text-destructive shadow-sm">
<span className="font-medium mr-1">{creationMode === "image_transform" ? tr("本页转化失败:", "Slide transform failed:") : tr("本页美化失败:", "Slide beautify failed:")}</span>
<span>{status.currentSlideFailure}</span>
</div>
@@ -406,18 +407,18 @@ export function DeckView({
)}
<div className="relative z-10 h-full flex flex-col">
- <h1 className="mb-8 w-fit border-b-4 border-blue-600 pb-4 pr-12 text-4xl font-bold text-zinc-900">
+ <h1 className="mb-8 w-fit border-b-4 border-[#C96442] pb-4 pr-12 text-4xl font-bold text-[#141413]">
{deck.currentSlide.title}
</h1>
<div className="flex-1 space-y-6">
{(deck.currentSlide.content || []).map((point, i) => (
- <div key={i} className="flex items-start gap-4 text-2xl leading-relaxed text-zinc-700">
- <span className="mt-2 text-blue-600">•</span>
+ <div key={i} className="flex items-start gap-4 text-2xl leading-relaxed text-[#3B3833]">
+ <span className="mt-2 text-primary">•</span>
<span>{point}</span>
</div>
))}
</div>
- <div className="mt-auto flex justify-between border-t border-zinc-100 pt-8 text-sm text-zinc-400">
+ <div className="mt-auto flex justify-between border-t border-[#E3DFD7] pt-8 text-sm text-[#6E6A62]">
<span>Generated by Unified AI Workspace</span>
<span>{deck.currentIndex + 1}</span>
</div>
@@ -429,10 +430,10 @@ export function DeckView({
{/* Overlay Label if Generated */}
{(status.isApplyingEdits || status.isGeneratingImage) && (
- <div className="absolute inset-0 z-50 flex items-center justify-center bg-white/50 backdrop-blur-[2px]">
- <div className="flex flex-col items-center gap-3 bg-white shadow-xl px-6 py-4 rounded-xl border border-blue-100">
- <Loader2 className="w-6 h-6 text-blue-600 animate-spin" />
- <span className="text-sm font-medium text-zinc-700">{tr("幻灯片正在生成中...", "Generating slides...")}</span>
+ <div className="absolute inset-0 z-50 flex items-center justify-center bg-background/60 backdrop-blur-[2px]">
+ <div className="flex flex-col items-center gap-3 bg-card shadow-soft-lg px-6 py-4 rounded-xl border border-primary/25">
+ <Loader2 className="w-6 h-6 text-primary animate-spin" />
+ <span className="text-sm font-medium text-foreground/80">{tr("幻灯片正在生成中...", "Generating slides...")}</span>
</div>
</div>
)}
@@ -511,18 +512,18 @@ export function DeckView({
renderScaledSlideScene(deck.slides[slideshow.index], false, slideWidth, slideHeight)
) : (
<div className="w-full h-full p-16 flex flex-col">
- <h1 className="text-5xl font-bold mb-12 text-zinc-900 border-b-4 border-blue-600 pb-6 w-fit pr-16">
+ <h1 className="text-5xl font-bold mb-12 text-[#141413] border-b-4 border-[#C96442] pb-6 w-fit pr-16">
{deck.slides[slideshow.index].title}
</h1>
<div className="flex-1 space-y-8">
{(deck.slides[slideshow.index].content || []).map((point, i) => (
- <div key={i} className="flex gap-6 text-3xl text-zinc-700 leading-relaxed items-start">
- <span className="text-blue-600 mt-2">•</span>
+ <div key={i} className="flex gap-6 text-3xl text-[#3B3833] leading-relaxed items-start">
+ <span className="text-primary mt-2">•</span>
<span>{point}</span>
</div>
))}
</div>
- <div className="mt-auto pt-8 flex justify-between text-lg text-zinc-400 border-t border-zinc-100">
+ <div className="mt-auto pt-8 flex justify-between text-lg text-[#6E6A62] border-t border-[#E3DFD7]">
<span>Generated by Unified AI Workspace</span>
<span>{slideshow.index + 1}</span>
</div>
diff --git a/client/workspaces/ppt/canvas/views/GenerationProgress.tsx b/client/workspaces/ppt/canvas/views/GenerationProgress.tsx
index 758b852..0b90511 100644
--- a/client/workspaces/ppt/canvas/views/GenerationProgress.tsx
+++ b/client/workspaces/ppt/canvas/views/GenerationProgress.tsx
@@ -25,13 +25,13 @@ export function GenerationProgress({ step, progress, tr }: GenerationProgressPro
const isRendering = step === "generating_images";
return (
- <div className="w-full h-full bg-zinc-50 dark:bg-zinc-900 flex flex-col overflow-hidden">
+ <div className="w-full h-full bg-sunken flex flex-col overflow-hidden">
<div className="flex-1 flex items-center justify-center p-6">
- <div className="w-full max-w-md bg-white dark:bg-zinc-800 p-8 rounded-xl shadow-lg text-center space-y-6">
+ <div className="w-full max-w-md bg-card p-8 rounded-2xl shadow-soft-lg text-center space-y-6">
<div className="relative w-20 h-20 mx-auto">
<svg className="w-full h-full" viewBox="0 0 100 100">
<circle
- className="text-zinc-200 dark:text-zinc-700 stroke-current"
+ className="text-foreground/80 stroke-current"
strokeWidth="8"
cx="50"
cy="50"
@@ -39,7 +39,7 @@ export function GenerationProgress({ step, progress, tr }: GenerationProgressPro
fill="transparent"
/>
<circle
- className="text-blue-600 stroke-current transition-all duration-300 ease-in-out origin-center -rotate-90"
+ className="text-primary stroke-current transition-all duration-300 ease-in-out origin-center -rotate-90"
strokeWidth="8"
strokeLinecap="round"
cx="50"
@@ -60,7 +60,7 @@ export function GenerationProgress({ step, progress, tr }: GenerationProgressPro
</div>
<div className="flex justify-center gap-2 text-xs text-muted-foreground">
- <div className={`flex items-center gap-1 ${isRendering ? "text-blue-600" : ""}`}>
+ <div className={`flex items-center gap-1 ${isRendering ? "text-primary" : ""}`}>
{isRendering ? <Loader2 className="w-3 h-3 animate-spin" /> : <Check className="w-3 h-3" />}
<span>{tr("渲染图片", "Render images")}</span>
</div>
diff --git a/client/workspaces/ppt/canvas/views/OutlineReview.tsx b/client/workspaces/ppt/canvas/views/OutlineReview.tsx
index 085b165..fd834b7 100644
--- a/client/workspaces/ppt/canvas/views/OutlineReview.tsx
+++ b/client/workspaces/ppt/canvas/views/OutlineReview.tsx
@@ -34,9 +34,9 @@ export function OutlineReview({
onGenerate,
}: OutlineReviewProps) {
return (
- <div className="w-full h-full bg-zinc-50 dark:bg-zinc-900 flex flex-col overflow-hidden">
+ <div className="w-full h-full bg-sunken flex flex-col overflow-hidden">
<div className="flex-1 overflow-auto p-6">
- <div className="w-full min-h-full bg-white dark:bg-zinc-800 rounded-xl shadow-sm flex flex-col overflow-hidden">
+ <div className="w-full min-h-full bg-card rounded-2xl shadow-soft flex flex-col overflow-hidden">
<div className="p-6 border-b border-border flex justify-between items-center">
<h3 className="font-semibold text-lg">{tr("确认大纲", "Review outline")}</h3>
<div className="text-sm text-muted-foreground">{tr(`共 ${slides.length} 页`, `${slides.length} slides`)}</div>
@@ -44,13 +44,17 @@ export function OutlineReview({
<div className="flex-1 overflow-y-auto p-6 space-y-4">
{slides.length === 0 && (
- <div className="rounded-lg border border-dashed border-zinc-300 bg-zinc-50 px-4 py-6 text-center text-sm text-zinc-500">
+ <div className="rounded-lg border border-dashed border-input bg-sunken px-4 py-6 text-center text-sm text-muted-foreground">
{tr("当前没有大纲,请返回修改后重新生成。", "No outline yet. Go back and regenerate.")}
</div>
)}
{slides.map((slide, i) => (
- <div key={slide.id || i} className="flex gap-4 p-4 border rounded-lg bg-zinc-50 dark:bg-zinc-900/50">
- <div className="w-8 h-8 flex items-center justify-center bg-white dark:bg-zinc-800 rounded-full border text-sm font-medium text-muted-foreground">
+ <div
+ key={slide.id || i}
+ style={{ animationDelay: `${Math.min(i, 10) * 40}ms` }}
+ className="animate-rise-in flex gap-4 p-4 border border-border/70 rounded-xl bg-sunken transition-[border-color,box-shadow] duration-base ease-out-soft hover:border-border hover:shadow-soft"
+ >
+ <div className="w-8 h-8 flex items-center justify-center bg-card rounded-full border text-sm font-medium text-muted-foreground">
{i + 1}
</div>
<div className="flex-1 space-y-2">
@@ -238,8 +242,8 @@ export function OutlineReview({
title={tr(`插入第 ${idx + 1} 张素材`, `Insert material ${idx + 1}`)}
className={`flex w-full items-center gap-2 rounded-md border px-2 py-1.5 text-left text-xs ${
materials.picker.activeIndex === idx
- ? "border-blue-300 bg-blue-100 text-blue-800 ring-1 ring-blue-300"
- : "border-blue-200 bg-blue-50 text-blue-700 hover:bg-blue-100"
+ ? "border-primary/40 bg-primary/12 text-primary ring-1 ring-primary/40"
+ : "border-primary/30 bg-primary/[0.08] text-primary hover:bg-primary/15"
}`}
>
<img src={img.dataUrl} alt={img.name} className="h-8 w-8 rounded object-cover" />
@@ -257,7 +261,7 @@ export function OutlineReview({
type="button"
onClick={() => materials.editor.inputRefs.current[slide.id]?.click()}
title={tr("上传素材图片", "Upload material images")}
- className="inline-flex items-center gap-1 rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-700 hover:bg-zinc-100"
+ className="inline-flex items-center gap-1 rounded-md border border-input px-2 py-1 text-xs text-foreground/80 hover:bg-accent"
>
<Upload className="h-3.5 w-3.5" />
{tr("上传", "Upload")}
@@ -278,7 +282,7 @@ export function OutlineReview({
/>
</div>
{(materials.slideMaterials[slide.id] || []).length === 0 ? (
- <div className="rounded-md border border-dashed border-zinc-300 px-3 py-2 text-xs text-zinc-500">
+ <div className="rounded-md border border-dashed border-input px-3 py-2 text-xs text-muted-foreground">
{tr("暂无素材,上传后可在 description 输入 / 选择变量", "No materials yet. Upload images, then type / in description to insert variables.")}
</div>
) : (
@@ -297,7 +301,7 @@ export function OutlineReview({
e.stopPropagation();
materials.setPreview({ open: true, slideTitle: slide.title, item: img });
}}
- className="absolute bottom-1 left-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-blue-600/85 text-white opacity-0 transition-all group-hover:opacity-100 hover:bg-blue-700"
+ className="absolute bottom-1 left-1 inline-flex h-5 w-5 items-center justify-center rounded-full bg-primary/85 text-primary-foreground opacity-0 transition-all group-hover:opacity-100 hover:bg-primary/90"
aria-label={tr("查看素材", "Preview material")}
title={tr("查看", "Preview")}
>
@@ -319,7 +323,7 @@ export function OutlineReview({
<button
type="button"
onClick={() => materials.setPreview({ open: true, slideTitle: slide.title, item: img })}
- className="mt-1 w-full truncate text-center text-xs text-foreground hover:text-blue-600"
+ className="mt-1 w-full truncate text-center text-xs text-foreground hover:text-primary"
title={tr("点击查看素材", "Click to preview material")}
>
{img.name}
@@ -335,9 +339,9 @@ export function OutlineReview({
))}
</div>
- <div className="p-6 border-t border-border bg-zinc-50/50 dark:bg-zinc-900/50 flex justify-end gap-3">
+ <div className="p-6 border-t border-border bg-sunken/50 flex justify-end gap-3">
<Button variant="outline" onClick={onBack}>{tr("返回修改", "Back")}</Button>
- <Button onClick={onGenerate} className="bg-blue-600 hover:bg-blue-700" disabled={slides.length === 0}>
+ <Button onClick={onGenerate} className="bg-primary hover:bg-primary/90" disabled={slides.length === 0}>
<Sparkles className="w-4 h-4 mr-2" />
{tr("生成完整 PPT", "Generate full deck")}
</Button>