完善seo

This commit is contained in:
ymk
2025-07-31 20:13:02 +08:00
parent 0bb1a98696
commit 4485c88a11
10 changed files with 161 additions and 223 deletions

View File

@@ -12,17 +12,16 @@ import { useTranslations } from "next-intl";
* 全特性工具栏
* @returns
*/
export default function Page() {
export default function Page({ textProp, backgroundProp }: { textProp: TextProp | undefined, backgroundProp: BackgroundProp | undefined }) {
const t = useTranslations("TextEditor");
const [background, setBackground] = useState<BackgroundProp>({
const [background, setBackground] = useState<BackgroundProp>(backgroundProp || {
type: "color",
color: "#c4b1b1",
image: null,
});
const [text, setText] = useState<TextProp>({
const [text, setText] = useState<TextProp>(textProp || {
text: t("defaultText"),
color: "#8e86fe",
font: FontNames[0],

View File

@@ -8,18 +8,6 @@ export default function Footer() {
<footer className="w-full border-t backdrop-blur-sm bg-background/95 ">
<Flex justify={"between"} align={"center"} direction={"column"} gap={"2"} p="2">
<Flex justify={"center"} gap={"4"}>
<Link
href="/black-screen"
className="text-sm text-muted-foreground hover:text-primary"
>
Black Screen
</Link>
<Link
href="/white-screen"
className="text-sm text-muted-foreground hover:text-primary"
>
White Screen
</Link>
<Link
href="/do-not-write-on-this-page"
className="text-sm text-muted-foreground hover:text-primary"

View File

@@ -15,16 +15,6 @@ export default function Header() {
</Box >
<Flex gap={"4"} justify={"between"} align={"center"}>
<Link
href="/black-screen"
>
Black Screen
</Link>
<Link
href="/white-screen"
>
White Screen
</Link>
<Link
href="/do-not-write-on-this-page"
>

View File

@@ -4,7 +4,7 @@ import { useTranslations } from "next-intl";
import { Eye, Download } from "lucide-react";
import { BackgroundProp } from "./BackgroundSelector";
import { TextProp } from "./TextSetting";
import { Box, Flex } from "@radix-ui/themes";
import { Text, Flex } from "@radix-ui/themes";
import { getPicture, resize, init as threeInit, updateBackground, updateTextProps } from "./ThreeTools";
const Sizes = [
@@ -13,7 +13,6 @@ const Sizes = [
"800x600",
]
function gcd(a: number, b: number): number {
return b === 0 ? a : gcd(b, a % b);
}
@@ -128,6 +127,12 @@ export default function PreviewToolbar({
return (
<Flex direction={"column"} justify={"center"} align={"center"} p="2" className="rounded-lg border w-full" gap={"2"}>
<Flex gap={"4"} >
{t("tipsTitle")}:
<Text>{t("mouseLeft")}</Text>
<Text>{t("mouseMiddle")}</Text>
<Text>{t("mouseRight")}</Text>
</Flex>
<canvas ref={container} className="w-full border border-gray-300" style={{
aspectRatio: AspectRatio[aspectRadio],
// backgroundColor: background.type === "color" ? background.color : "none",

View File

@@ -1,6 +1,5 @@
import { Flex, Heading } from "@radix-ui/themes";
import { useTranslations } from "next-intl";
import { useEffect } from "react";
export interface TextProp {
text: string;
@@ -10,13 +9,18 @@ export interface TextProp {
}
export function getFontPath(fontName: string, fontWeight: String) {
return `/fonts/${fontName}_${fontWeight}.typeface.json`;
if (fontName != "noto_sans_zh") {
return `/fonts/${fontName}_${fontWeight}.typeface.json`;
} else {
fontWeight = fontWeight.charAt(0).toUpperCase() + fontWeight.slice(1);
return `https://fast3dtest.mysoul.fun/Noto_Sans_SC_${fontWeight}.json`;
}
}
export const FontWeights = ["regular", "bold"];
export const FontNames = ["gentilis", "helvetiker", "optimer"];
export const FontNames = ["gentilis", "helvetiker", "optimer", "noto_sans_zh"];
export default function TextEditor({
export default function TextSetting({
text,
setText,
}: {