parent
0fb6dc2407
commit
a0ace3bda9
@ -1,37 +1,31 @@
|
||||
'use client';
|
||||
import LibFlexible from '@/components/LibFlexible';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
import { RegularFont } from '@/utils/font';
|
||||
|
||||
import './globals.css';
|
||||
import type { Metadata, Viewport } from 'next';
|
||||
|
||||
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
import './globals.css';
|
||||
|
||||
const setRem = async () => {
|
||||
await import('lib-flexible');
|
||||
setLoaded(true);
|
||||
};
|
||||
export const metadata: Metadata = {
|
||||
title: '雀乐',
|
||||
description: '独立 不独于世',
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
setRem();
|
||||
window.addEventListener('resize', setRem);
|
||||
return () => {
|
||||
window.removeEventListener('resize', setRem);
|
||||
};
|
||||
}, []);
|
||||
export const viewport: Viewport = {
|
||||
width: 'device-width',
|
||||
initialScale: 1,
|
||||
maximumScale: 1,
|
||||
minimumScale: 1,
|
||||
userScalable: false,
|
||||
viewportFit: 'cover',
|
||||
};
|
||||
|
||||
export default function RootLayout({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||
return (
|
||||
<html lang="zn-ch">
|
||||
<head>
|
||||
<meta
|
||||
name="viewport"
|
||||
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no,viewport-fit=cover"
|
||||
/>
|
||||
<meta httpEquiv="X-UA-Compatible" content="ie=edge" />
|
||||
<title>雀乐</title>
|
||||
<meta name="description" content="独立 不独于世" />
|
||||
</head>
|
||||
<body>{loaded ? children : null}</body>
|
||||
<html lang="zn-ch" className={RegularFont.className}>
|
||||
<body>
|
||||
<LibFlexible>{children}</LibFlexible>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
import Image from 'next/image';
|
||||
|
||||
import { XinYiJiXiangSongFont } from '@/utils/font';
|
||||
|
||||
export default function AppLogo(props: { className?: string }) {
|
||||
const cls = props.className || '';
|
||||
return (
|
||||
<div className={`flex flex-col items-center ${cls}`}>
|
||||
<Image className="w-[90px] h-[90px]" width={90} height={90} src="/img/app_icon_white_bg.svg" alt="queyue" />
|
||||
<p className={`${XinYiJiXiangSongFont.className} text-[20px] leading-[24px] mt-[20px] tracking-[3px]`}>
|
||||
独立 不独于世
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
'use client';
|
||||
|
||||
import { useState, useEffect } from 'react';
|
||||
|
||||
export default function LibFlexible({ children }: Readonly<{ children: React.ReactNode }>) {
|
||||
const [loaded, setLoaded] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
const setRem = async () => {
|
||||
await import('lib-flexible');
|
||||
setLoaded(true);
|
||||
};
|
||||
setRem();
|
||||
}, []);
|
||||
|
||||
return loaded ? children : null;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
import localFont from 'next/font/local';
|
||||
|
||||
export const RegularFont = localFont({
|
||||
src: '../../public/fonts/ping-fang-hei-ti-zhun-jian.ttf',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const MediumFont = localFont({
|
||||
src: '../../public/fonts/pingfang-sc-medium.otf',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const SemiboldFont = localFont({
|
||||
src: '../../public/fonts/pingfangsc-semibold.otf',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const AbhayaFont = localFont({
|
||||
src: '../../public/fonts/AlibabaPuHuiTi-3-65-Medium.woff2',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const AbhayaSemiboldFont = localFont({
|
||||
src: '../../public/fonts/abhayalibre-semibold.ttf',
|
||||
display: 'swap',
|
||||
});
|
||||
|
||||
export const XinYiJiXiangSongFont = localFont({
|
||||
src: '../../public/fonts/Fontquan-XinYiJiXiangSong.ttf',
|
||||
display: 'swap',
|
||||
});
|
Loading…
Reference in new issue