feat(assets): add initial fonts and image assets

This commit is contained in:
2026-06-09 15:47:20 +08:00
parent cda55c8f9b
commit e2f60bc4f2
41 changed files with 207 additions and 70 deletions
+35 -1
View File
@@ -1,5 +1,6 @@
import type { Metadata } from "next";
import { Geist, Geist_Mono } from "next/font/google";
import localFont from "next/font/local";
import Script from "next/script";
import "./globals.css";
@@ -15,6 +16,39 @@ const geistMono = Geist_Mono({
subsets: ["latin"],
});
/**
* Athelas 字体加载
* 原始资源:/Users/chase/Documents/cozsweet/fonts/Athelas-*.ttf
* 放置位置:/public/fonts/Athelas-*.ttf
*
* 路径计算(`next/font/local` 要求相对路径从调用文件出发):
* src/app/layout.tsx → ../../public/fonts/...
*
* 通过 `next/font/local` 自动 preload、压缩、inline。
* 输出 CSS 变量 `--font-athelas`,由 `globals.css` 桥接到 Tailwind `font-athelas`。
*/
const athelas = localFont({
src: [
{
path: "../../public/fonts/Athelas-Regular.ttf",
weight: "400",
style: "normal",
},
{
path: "../../public/fonts/Athelas-Bold.ttf",
weight: "700",
style: "normal",
},
{
path: "../../public/fonts/Athelas-BoldItalic.ttf",
weight: "700",
style: "italic",
},
],
variable: "--font-athelas",
display: "swap",
});
export const metadata: Metadata = {
title: "cozsweet",
description: "cozsweet frontend (Next.js)",
@@ -31,7 +65,7 @@ export default function RootLayout({
<html
lang="en"
suppressHydrationWarning
className={`${geistSans.variable} ${geistMono.variable} h-full antialiased`}
className={`${geistSans.variable} ${geistMono.variable} ${athelas.variable} h-full antialiased`}
>
<body className="min-h-full flex flex-col">
{/* Facebook SDK JSauth + splash 入口会用到 FB.login */}