- 创建 lib/constants/theme.ts 统一管理颜色和品牌常量 - 重构 icon.tsx 和 apple-icon.tsx 使用共享常量 - 修复 middleware matcher 排除 icon/apple-icon 路由
28 lines
662 B
TypeScript
28 lines
662 B
TypeScript
import { ImageResponse } from "next/og";
|
|
import { COLORS, BRAND } from "@/lib/constants";
|
|
|
|
export const size = { width: 180, height: 180 };
|
|
export const contentType = "image/png";
|
|
|
|
export default function AppleIcon() {
|
|
return new ImageResponse(
|
|
(
|
|
<div
|
|
style={{
|
|
width: "100%",
|
|
height: "100%",
|
|
display: "flex",
|
|
alignItems: "center",
|
|
justifyContent: "center",
|
|
background: `linear-gradient(135deg, ${COLORS.bgPrimary} 0%, ${COLORS.bgSecondary} 100%)`,
|
|
borderRadius: "40px",
|
|
fontSize: 120,
|
|
}}
|
|
>
|
|
{BRAND.emoji}
|
|
</div>
|
|
),
|
|
size
|
|
);
|
|
}
|