Skip to content

Commit a0dba26

Browse files
author
aihunter
committed
feature: fix 样式
1 parent b12fa06 commit a0dba26

File tree

6 files changed

+66
-7
lines changed

6 files changed

+66
-7
lines changed

app/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ export default function Home() {
99
{/* flex flex-col items-center justify-center min-h-[85vh] px-8 font-sans */}
1010
<main className="w-full max-w-6xl mx-auto">
1111
<h1 className="text-3xl font-bold text-center">汉语新解</h1>
12-
<h2 className="text-lg text-center font-sans font-semibold inline-flex gap-2 items-center justify-center mx-auto w-full">
13-
输入一个汉语词汇,获取一个全新的解释
12+
<h2 className="text-lg text-center font-sans font-semibold flex flex-col sm:flex-row gap-2 items-center justify-center mx-auto w-full">
13+
<span>输入一个汉语词汇,获取一个全新的解释</span>
1414
<WordRotate
15-
className=" bg-clip-text text-transparent bg-gradient-to-r from-teal-500 to-sky-500"
15+
className="bg-clip-text text-transparent bg-gradient-to-r from-teal-500 to-sky-500"
1616
words={["国足", "程序员", "打工人", "天选之子"]}
1717
/>
1818
</h2>

components/PresetTemplateGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ const PresetTemplateGrid: React.FC<PresetTemplateGridProps> = ({
119119
onClick={() => copyImageToClipboard(template.svg)}
120120
>
121121
<Copy className="w-4 h-4 mr-2" />
122-
复制图片
122+
复制图片 (PC端)
123123
</Button>
124124
<Button
125125
variant="outline"

components/svg-generator.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ import { Input } from "@/components/ui/input";
66
import { Button } from "@/components/ui/button";
77
import { Card, CardContent } from "@/components/ui/card";
88
import { Loader2, Copy, Download } from "lucide-react";
9-
import { toast } from "react-toastify";
9+
import { toast } from "sonner";
1010
import { presetTemplates } from "@/lib/constants";
1111
import PresetTemplateGrid from "./PresetTemplateGrid";
1212

13-
const presetPrompts = ["国足", "程序员", "打工人"];
14-
1513
export default function SvgGenerator() {
1614
const [text, setText] = useState("");
1715
const [svg, setSvg] = useState("");

components/ui/sonner.tsx

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
"use client"
2+
3+
import { useTheme } from "next-themes"
4+
import { Toaster as Sonner } from "sonner"
5+
6+
type ToasterProps = React.ComponentProps<typeof Sonner>
7+
8+
const Toaster = ({ ...props }: ToasterProps) => {
9+
const { theme = "system" } = useTheme()
10+
11+
return (
12+
<Sonner
13+
theme={theme as ToasterProps["theme"]}
14+
className="toaster group"
15+
toastOptions={{
16+
classNames: {
17+
toast:
18+
"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",
19+
description: "group-[.toast]:text-muted-foreground",
20+
actionButton:
21+
"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",
22+
cancelButton:
23+
"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground",
24+
},
25+
}}
26+
{...props}
27+
/>
28+
)
29+
}
30+
31+
export { Toaster }

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@
1818
"framer-motion": "^11.5.4",
1919
"lucide-react": "^0.439.0",
2020
"next": "14.2.10",
21+
"next-themes": "^0.3.0",
2122
"openai": "^4.59.0",
2223
"react": "^18",
2324
"react-dom": "^18",
2425
"react-toastify": "^10.0.5",
2526
"react-type-animation": "^3.2.0",
27+
"sonner": "^1.5.0",
2628
"tailwind-merge": "^2.5.2",
2729
"tailwindcss-animate": "^1.0.7"
2830
},

pnpm-lock.yaml

Lines changed: 28 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)