对齐新版首页对话区布局与卡片展示样式
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-02-13 20:34:37 +08:00
parent c4bc8875a7
commit 8b19982bca

View File

@ -4,18 +4,25 @@ import { Fragment, useEffect, useMemo, useRef, useState } from "react";
import { useRouter } from "next/navigation"; import { useRouter } from "next/navigation";
import useSWR from "swr"; import useSWR from "swr";
import { import {
ArrowRight,
ArrowUp,
Bell, Bell,
ChevronDown, ChevronDown,
Clapperboard,
Folder, Folder,
Globe, Globe,
Heart, Heart,
Hexagon, Hexagon,
Home, Home,
ImageIcon,
Info, Info,
MapPin, Lightbulb,
Monitor,
Palette,
Plus, Plus,
Send, Send,
Sparkles, Sparkles,
Star,
Upload, Upload,
User, User,
Zap, Zap,
@ -107,16 +114,15 @@ const DISCOVERY_DEFAULT_TABS = [
]; ];
const PROMPT_TAGS = [ const PROMPT_TAGS = [
"Nano Banana Pro", { label: "Nano Banana Pro", icon: Sparkles, highlighted: true },
"Design", { label: "Design", icon: ImageIcon, highlighted: false },
"Branding", { label: "Branding", icon: Star, highlighted: false },
"Illustration", { label: "Illustration", icon: Palette, highlighted: false },
"E-Commerce", { label: "E-Commerce", icon: Monitor, highlighted: false },
"Video", { label: "Video", icon: Clapperboard, highlighted: false },
]; ];
const MASONRY_HEIGHTS = [420, 290, 340, 470, 300, 360, 430, 320]; const MASONRY_HEIGHTS = [420, 290, 340, 470, 300, 360, 430, 320];
const UI_SCALE = 0.7;
function formatRelativeTime(value?: string) { function formatRelativeTime(value?: string) {
if (!value) return "更新于今天"; if (!value) return "更新于今天";
@ -329,7 +335,7 @@ export function LovartHome({
}; };
return ( return (
<div className="min-h-svh bg-[#f4f4f4] text-[#171717]" style={{ zoom: UI_SCALE }}> <div className="min-h-svh bg-[#f4f4f4] text-[#171717]">
<header className="fixed left-0 top-0 z-40 h-[68px] w-full border-b border-black/5 bg-[#f4f4f4]/90 backdrop-blur"> <header className="fixed left-0 top-0 z-40 h-[68px] w-full border-b border-black/5 bg-[#f4f4f4]/90 backdrop-blur">
<div className="mx-auto flex h-full max-w-[1360px] items-center justify-between px-6"> <div className="mx-auto flex h-full max-w-[1360px] items-center justify-between px-6">
<button <button
@ -344,7 +350,7 @@ export function LovartHome({
<Sparkles className="h-4 w-4" /> <Sparkles className="h-4 w-4" />
</div> </div>
)} )}
<span className="text-[20px] font-semibold leading-none tracking-tight"> <span className="text-[28px] font-semibold leading-none tracking-tight">
{siteName || "Lovart"} {siteName || "Lovart"}
</span> </span>
</button> </button>
@ -481,26 +487,26 @@ export function LovartHome({
<span className="text-[#ff7a00]">立即升级</span> <span className="text-[#ff7a00]">立即升级</span>
</button> </button>
<div className="mt-9 flex items-center justify-center gap-2"> <div className="mt-9 flex items-center justify-center gap-3">
{siteLogo ? ( {siteLogo ? (
<img src={siteLogo} alt={siteName} className="h-10 w-10 rounded-full object-cover" /> <img src={siteLogo} alt={siteName} className="h-12 w-12 rounded-full object-cover" />
) : ( ) : (
<div className="flex h-10 w-10 items-center justify-center rounded-full bg-black text-white"> <div className="flex h-12 w-12 items-center justify-center rounded-full bg-black text-white">
<Sparkles className="h-4 w-4" /> <Sparkles className="h-5 w-5" />
</div> </div>
)} )}
<h1 className="text-[42px] font-semibold tracking-tight"> <h1 className="text-[50px] font-semibold tracking-tight">
{siteName || "Lovart"} 让设计更简单 {siteName || "Lovart"} 让设计更简单
</h1> </h1>
</div> </div>
<p className="mt-2 text-base text-black/35">懂你的设计代理,帮你搞定一切</p> <p className="mt-2 text-[36px] text-black/35">懂你的设计代理,帮你搞定一切</p>
<div className="mx-auto mt-7 w-full max-w-[900px] rounded-[26px] border border-black/10 bg-white px-4 pb-3 pt-4 shadow-[0_10px_24px_rgba(0,0,0,0.05)]"> <div className="mx-auto mt-7 w-full max-w-[900px] rounded-[30px] border border-black/10 bg-white px-5 pb-4 pt-5 shadow-[0_10px_24px_rgba(0,0,0,0.05)]">
<Textarea <Textarea
value={prompt} value={prompt}
onChange={(event) => setPrompt(event.target.value)} onChange={(event) => setPrompt(event.target.value)}
placeholder="让 Lovart 打造引人注目的社交媒体视觉" placeholder="让 Lovart 打造引人注目的社交媒体视觉"
className="min-h-[92px] resize-none border-0 bg-transparent px-1 text-base shadow-none focus-visible:ring-0" className="min-h-[104px] resize-none border-0 bg-transparent px-1 text-[34px] shadow-none focus-visible:ring-0"
/> />
{files.length > 0 && ( {files.length > 0 && (
@ -521,8 +527,8 @@ export function LovartHome({
)} )}
<div className="flex items-center justify-between border-t border-black/8 pt-3"> <div className="flex items-center justify-between border-t border-black/8 pt-3">
<label className="inline-flex h-9 w-9 cursor-pointer items-center justify-center rounded-full border border-black/10 text-black/60 hover:bg-black/5"> <label className="inline-flex h-11 w-11 cursor-pointer items-center justify-center rounded-full border border-black/10 text-black/60 hover:bg-black/5">
<Upload className="h-4 w-4" /> <Upload className="h-5 w-5" />
<input <input
type="file" type="file"
accept="image/*" accept="image/*"
@ -535,42 +541,43 @@ export function LovartHome({
/> />
</label> </label>
<div className="flex items-center gap-1.5"> <div className="flex items-center gap-2">
<button className="flex h-8 w-8 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5"> <button className="flex h-10 w-10 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5">
<MapPin className="h-3.5 w-3.5" /> <Lightbulb className="h-4 w-4" />
</button> </button>
<button className="flex h-8 w-8 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5"> <button className="flex h-10 w-10 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5">
<Zap className="h-3.5 w-3.5" /> <Zap className="h-4 w-4" />
</button> </button>
<button className="flex h-8 w-8 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5"> <button className="flex h-10 w-10 items-center justify-center rounded-full border border-black/10 text-black/50 hover:bg-black/5">
<Globe className="h-3.5 w-3.5" /> <Globe className="h-4 w-4" />
</button> </button>
<button className="flex h-8 w-8 items-center justify-center rounded-full border border-[#72a3ff] text-[#3a78f2]"> <button className="flex h-10 w-10 items-center justify-center rounded-full border border-[#72a3ff] text-[#3a78f2]">
<Hexagon className="h-3.5 w-3.5" /> <Hexagon className="h-4 w-4" />
</button> </button>
<Button <Button
onClick={createCanvasFromComposer} onClick={createCanvasFromComposer}
disabled={isSubmitting || (!prompt.trim() && files.length === 0)} disabled={isSubmitting || (!prompt.trim() && files.length === 0)}
className="h-8 w-8 rounded-full bg-[#9ca3af] p-0 text-white hover:bg-black" className="h-10 w-10 rounded-full bg-[#9ca3af] p-0 text-white hover:bg-black"
> >
<Send className="h-3.5 w-3.5" /> <ArrowUp className="h-4 w-4" />
</Button> </Button>
</div> </div>
</div> </div>
</div> </div>
<div className="mt-5 flex flex-wrap items-center justify-center gap-2"> <div className="mt-5 flex flex-wrap items-center justify-center gap-2">
{PROMPT_TAGS.map((tag, index) => ( {PROMPT_TAGS.map((tag) => (
<button <button
key={tag} key={tag.label}
type="button" type="button"
className={`rounded-full border px-3 py-1.5 text-sm ${ className={`inline-flex items-center gap-1.5 rounded-full border px-3.5 py-1.5 text-[26px] ${
index === 0 tag.highlighted
? "border-[#ffb15f] bg-[#fff4e7] text-[#ff8c1f]" ? "border-[#ffb15f] bg-[#fff4e7] text-[#ff8c1f]"
: "border-black/15 bg-white text-black/70" : "border-black/15 bg-white text-black/70"
}`} }`}
> >
{tag} <tag.icon className="h-4 w-4" />
{tag.label}
</button> </button>
))} ))}
</div> </div>
@ -581,10 +588,11 @@ export function LovartHome({
<h2 className="text-3xl font-semibold tracking-tight">最近项目</h2> <h2 className="text-3xl font-semibold tracking-tight">最近项目</h2>
<button <button
type="button" type="button"
className="text-base text-black/45 hover:text-black" className="inline-flex items-center gap-1 text-base text-black/45 hover:text-black"
onClick={() => router.push("/canvas")} onClick={() => router.push("/canvas")}
> >
查看全部 查看全部
<ArrowRight className="h-4 w-4" />
</button> </button>
</div> </div>
@ -703,10 +711,7 @@ export function LovartHome({
</button> </button>
<Dialog open={upgradeDialogOpen} onOpenChange={setUpgradeDialogOpen}> <Dialog open={upgradeDialogOpen} onOpenChange={setUpgradeDialogOpen}>
<DialogContent <DialogContent className="max-h-[92vh] w-[95vw] max-w-[1240px] overflow-hidden rounded-3xl border-black/10 bg-[#f7f7f7] p-0">
className="max-h-[92vh] w-[95vw] max-w-[1240px] overflow-hidden rounded-3xl border-black/10 bg-[#f7f7f7] p-0"
style={{ zoom: UI_SCALE }}
>
<div className="flex h-full max-h-[92vh] flex-col"> <div className="flex h-full max-h-[92vh] flex-col">
<DialogHeader className="border-b border-black/6 px-6 py-5"> <DialogHeader className="border-b border-black/6 px-6 py-5">
<DialogTitle className="text-center text-5xl font-bold text-black">升级您的套餐</DialogTitle> <DialogTitle className="text-center text-5xl font-bold text-black">升级您的套餐</DialogTitle>