From 433e08f2f798b4c04d57cd2d61b16a58aa5196be Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Sun, 13 Oct 2024 00:38:37 +0800 Subject: core: added home page --- app/lib/fonts.tsx | 41 +++++++++++++++++++++++++++++++++++++++++ app/lib/isMobile.tsx | 9 +++++++++ 2 files changed, 50 insertions(+) create mode 100644 app/lib/fonts.tsx create mode 100644 app/lib/isMobile.tsx (limited to 'app/lib') diff --git a/app/lib/fonts.tsx b/app/lib/fonts.tsx new file mode 100644 index 0000000..3edbc52 --- /dev/null +++ b/app/lib/fonts.tsx @@ -0,0 +1,41 @@ +import localFont from "next/font/local"; +import { Inter, Audiowide, Rock_Salt, Monoton, JetBrains_Mono } from 'next/font/google' + +export const InterFont = Inter({ + variable: "--font-inter", + subsets: ['latin'], + display: 'swap', +}) + +export const MonotonFont = Monoton({ + weight: ['400'], + variable: "--font-monoton", + subsets: ['latin'], + display: 'swap', +}) + +export const RockSaltFont = Rock_Salt({ + weight: ['400'], + variable: "--font-rocksalt", + subsets: ['latin'], + display: 'swap', +}) + +export const JetBrainsMonoFont = JetBrains_Mono({ + weight: ['400'], + variable: "--font-jetbrains", + subsets: ['latin'], + display: 'swap', +}) + +export const hackedFont = localFont({ + src: "../fonts/Hacked-KerX.ttf" +}) + +export const smoothFont = localFont({ + src: "../fonts/SmoothElegantRegular-ZLv3.ttf" +}) + +export const bigFont = localFont({ + src: "../fonts/Big500-8MLOM.ttf" +}) \ No newline at end of file diff --git a/app/lib/isMobile.tsx b/app/lib/isMobile.tsx new file mode 100644 index 0000000..4ad8b03 --- /dev/null +++ b/app/lib/isMobile.tsx @@ -0,0 +1,9 @@ +"use server" + +import { userAgent } from 'next/server' +import { headers } from 'next/headers'; + +export default async function isMobile() { + const { device } = userAgent({ headers: headers() }); + return device.type === 'mobile'; +} \ No newline at end of file -- cgit v1.2.3