Skip to content

Commit

Permalink
wip: font
Browse files Browse the repository at this point in the history
  • Loading branch information
kasuie committed Jun 27, 2024
1 parent e3a4bcf commit 17b1e40
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 15 deletions.
Binary file removed public/fonts/Pacifico.ttf
Binary file not shown.
Binary file added public/fonts/XiaolaiMonoSC-Regular.ttf
Binary file not shown.
14 changes: 8 additions & 6 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: kasuie
* @Date: 2024-05-20 16:08:41
* @LastEditors: kasuie
* @LastEditTime: 2024-06-26 23:43:26
* @LastEditTime: 2024-06-27 18:09:42
* @Description:
*/
import type { Metadata } from "next";
Expand All @@ -13,8 +13,7 @@ import { getConfig } from "@/lib/config";
import { GoogleAnalytics, GoogleTagManager } from "@next/third-parties/google";
import Script from "next/script";
import "@/styles/index.css";

// const manrope = Manrope({ subsets: ["latin"] });
import StyleRegistry from "@/components/layout/StyleRegistry";

const inter = Inter({ subsets: ["latin"] });

Expand All @@ -39,12 +38,15 @@ export default async function RootLayout({
}: Readonly<{
children: React.ReactNode;
}>) {
// const appConfig = await getConfig("config.json");
const appConfig = await getConfig("config.json");
return (
<html lang="zh-CN" suppressHydrationWarning>
<body className={`${inter.className} mio-scroll overflow-y-auto`}>
<AppProviders>
<body
className={`${inter.className} mio-scroll mio-fonts overflow-y-auto`}
>
<AppProviders appConfig={appConfig}>
<Layout>{children}</Layout>
<StyleRegistry />
</AppProviders>
{process.env.GTAGID && <GoogleAnalytics gaId={process.env.GTAGID} />}
{process.env.GTMID && <GoogleTagManager gtmId={process.env.GTMID} />}
Expand Down
3 changes: 2 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: kasuie
* @Date: 2024-05-20 16:08:41
* @LastEditors: kasuie
* @LastEditTime: 2024-06-27 10:35:12
* @LastEditTime: 2024-06-27 17:46:12
* @Description:
*/
import { Loader } from "@/components/ui/loader/Loader";
Expand Down Expand Up @@ -35,6 +35,7 @@ export default async function Home() {
bgConfig,
theme,
footer,
globalStyle,
...others
} = transformConfig(await getConfig("config.json"));

Expand Down
4 changes: 2 additions & 2 deletions src/components/effect/TextEffect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @Author: kasuie
* @Date: 2024-05-22 14:29:52
* @LastEditors: kasuie
* @LastEditTime: 2024-06-12 22:01:30
* @LastEditTime: 2024-06-27 18:00:29
* @Description:
*/
"use client";
Expand Down Expand Up @@ -142,7 +142,7 @@ export function TextEffect({
return (
<motion.div
className={clsx(
`k-words-hearts z-[1] relative mx-4 min-h-[30px] text-center font-[cursive] text-[20px] text-white sm:mx-0`,
`k-words-hearts z-[1] relative mx-4 min-h-[30px] text-center text-[20px] text-white sm:mx-0`,
{
"mb-3": showFrom && typing,
}
Expand Down
8 changes: 2 additions & 6 deletions src/components/layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,11 @@
* @Author: kasuie
* @Date: 2024-05-20 17:15:33
* @LastEditors: kasuie
* @LastEditTime: 2024-06-26 23:02:57
* @LastEditTime: 2024-06-27 18:04:37
* @Description:
*/
import StyleRegistry from "./StyleRegistry";
export function Layout({ children }: { children: React.ReactNode }) {
return (
<>
<main className={"mio-fonts relative min-h-screen"}>{children}</main>;
<StyleRegistry></StyleRegistry>
</>
<main className={"relative min-h-screen"}>{children}</main>
);
}
9 changes: 9 additions & 0 deletions src/config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@
"style": "",
"istTransition": true
},
"globalStyle": {
"fonts": [
{
"src": "/fonts/XiaolaiMonoSC-Regular.ttf",
"name": "XiaolaiMonoSC"
}
],
"callback": "cursive,emoji"
},
"subTitle": "https://v1.hitokoto.cn?c=a&c=b&c=c",
"subTitleConfig": {
"typing": true,
Expand Down

0 comments on commit 17b1e40

Please sign in to comment.