File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- import SetColor from "@/components/SetColor" ;
21import SwitcherLink from "@/components/SwitcherLink" ;
32import { Metadata } from "next" ;
3+ import { CSSProperties } from "react" ;
44import "./globals.css" ;
55
66export const metadata : Metadata = {
@@ -13,9 +13,21 @@ export default function RootLayout({
1313} : Readonly < {
1414 children : React . ReactNode ;
1515} > ) {
16+ function getRandomColor ( ) {
17+ const letters = "89ABCDEF89ABCDEF" ;
18+ let color = "#" ;
19+ for ( let i = 0 ; i < 6 ; i ++ ) {
20+ // eslint-disable-next-line react-hooks/purity
21+ color += letters [ Math . floor ( Math . random ( ) * 16 ) ] ;
22+ }
23+ return color ;
24+ }
25+
1626 return (
17- < html lang = "en" >
18- < SetColor />
27+ < html
28+ lang = "en"
29+ style = { { "--secondary" : getRandomColor ( ) } as CSSProperties }
30+ >
1931 < body className = "antialiased flex flex-col min-h-screen" >
2032 < header className = "backdrop-blur-3xl border-b sticky top-0 min-w-full z-100" >
2133 < nav className = "flex gap-10 h-10 justify-center" >
You can’t perform that action at this time.
0 commit comments