mirror of
https://github.com/blueskychan-dev/blueskychan.dev.git
synced 2025-07-08 07:41:05 +00:00
41 lines
955 B
JavaScript
41 lines
955 B
JavaScript
import "~/styles/globals.css"
|
|
|
|
// pages/_app.js
|
|
import { useEffect } from "react"
|
|
import { useRouter } from "next/router"
|
|
import { Roboto, Mali } from "next/font/google"
|
|
import { Analytics } from '@vercel/analytics/next';
|
|
import { SpeedInsights } from '@vercel/speed-insights/next';
|
|
|
|
const roboto = Roboto({
|
|
weight: "400",
|
|
subsets: ["latin"],
|
|
})
|
|
|
|
const mali = Mali({ subsets: ["latin"], weight: "400" })
|
|
|
|
function MyApp({ Component, pageProps }) {
|
|
const router = useRouter()
|
|
|
|
const stright = router.query.stright !== undefined
|
|
useEffect(() => {
|
|
if (stright) {
|
|
document.body.classList.add(roboto.className)
|
|
document.body.classList.remove(mali.className)
|
|
} else {
|
|
document.body.classList.add(mali.className)
|
|
document.body.classList.remove(roboto.className)
|
|
}
|
|
}, [stright])
|
|
|
|
|
|
return (
|
|
<>
|
|
<Component {...pageProps} />
|
|
<Analytics />
|
|
<SpeedInsights />
|
|
</>
|
|
);
|
|
}
|
|
|
|
export default MyApp
|