-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHomeLink.js
35 lines (33 loc) · 945 Bytes
/
HomeLink.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"use client";
import { sans } from "./fonts";
import { usePathname } from "next/navigation";
import Link from "./Link";
export default function HomeLink() {
const pathname = usePathname();
const isActive = pathname === "/";
return (
<Link
href="/"
className={[
sans.className,
"inline-block text-2xl font-black",
isActive ? "" : "hover:scale-[1.02]",
].join(" ")}
>
<span
style={{
"--myColor1": isActive ? "var(--text)" : "var(--pink)",
"--myColor2": isActive ? "var(--text)" : "var(--purple)",
backgroundImage:
"linear-gradient(45deg, var(--myColor1), var(--myColor2))",
backgroundClip: "text",
WebkitBackgroundClip: "text",
color: "transparent",
transition: "--myColor1 0.2s ease-out, --myColor2 0.2s ease-in-out",
}}
>
light as bird
</span>
</Link>
);
}