File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,19 @@ import SpotlightCard from "./SpotlightCard";
33import { Sling as Hamburger } from "hamburger-react" ;
44import { GoArrowUpRight } from "react-icons/go" ;
55
6+ function oklchGradient (
7+ L0 : number , // lightness min
8+ L1 : number , // lightness max
9+ C : number , // chroma
10+ h : number , // hue
11+ i : number ,
12+ n : number ,
13+ ) {
14+ const t = n <= 1 ? 0 : i / ( n - 1 ) ;
15+ const L = L0 + t * ( L1 - L0 ) ;
16+ return `oklch(${ L } % ${ C } ${ h } )` ;
17+ }
18+
619const navs : Array < {
720 label : string ;
821 links : Array < { label : string ; href : string } > ;
@@ -66,6 +79,14 @@ export default function Header() {
6679 className = { `mt-5 w-full flex flex-col gap-3 translate-y-100 opacity-0` }
6780 style = { {
6881 animationDelay : `${ i * 100 + 100 } ms` ,
82+ backgroundColor : oklchGradient (
83+ 0 ,
84+ 10 ,
85+ 0.05 ,
86+ 300 ,
87+ i ,
88+ navs . length ,
89+ ) ,
6990 } }
7091 >
7192 < h3 className = "text-lg font-bold cursor-default" > { nav . label } </ h3 >
You can’t perform that action at this time.
0 commit comments