Skip to content

Commit ccb49d2

Browse files
Add smooth hover transitions to navbar interactive elements (#545)
Co-authored-by: Kevin Van Cott <[email protected]>
1 parent 7cbde06 commit ccb49d2

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

src/components/Navbar.tsx

Lines changed: 34 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function Navbar({ children }: { children: React.ReactNode }) {
7676
<Link
7777
to="/login"
7878
className="flex items-center gap-1 bg-gray-500/20 rounded-lg p-2 opacity-80
79-
hover:opacity-100 whitespace-nowrap uppercase font-black text-xs"
79+
hover:opacity-100 transition-opacity duration-300 ease-in-out whitespace-nowrap uppercase font-black text-xs"
8080
>
8181
<LuUser className="scale-125" />
8282
<div className="">Log In</div>
@@ -118,36 +118,41 @@ export function Navbar({ children }: { children: React.ReactNode }) {
118118
</>
119119
)
120120

121+
const socialLinksData = [
122+
{
123+
href: 'https://x.com/tan_stack',
124+
label: 'Follow TanStack on X.com',
125+
icon: <TbBrandX className="text-xl" />,
126+
},
127+
{
128+
href: 'https://bsky.app/profile/tanstack.com',
129+
label: 'Follow TanStack on Bluesky',
130+
icon: <TbBrandBluesky className="text-xl" />,
131+
},
132+
{
133+
href: 'https://instagram.com/tan_stack',
134+
label: 'Follow TanStack on Instagram',
135+
icon: <FaInstagram className="text-xl" />,
136+
},
137+
{
138+
href: 'https://tlinz.com/discord',
139+
label: 'Join TanStack Discord',
140+
icon: <FaDiscord className="text-xl" />,
141+
},
142+
]
143+
121144
const socialLinks = (
122145
<div className="flex items-center gap-1">
123-
<a
124-
href="https://x.com/tan_stack"
125-
className="opacity-70 hover:opacity-100"
126-
aria-label="Follow TanStack on X.com"
127-
>
128-
<TbBrandX className="text-xl" />
129-
</a>
130-
<a
131-
href="https://bsky.app/profile/tanstack.com"
132-
className="opacity-70 hover:opacity-100"
133-
aria-label="Follow TanStack on Bluesky"
134-
>
135-
<TbBrandBluesky className="text-xl" />
136-
</a>
137-
<a
138-
href="https://instagram.com/tan_stack"
139-
className="opacity-70 hover:opacity-100"
140-
aria-label="Follow TanStack on Instagram"
141-
>
142-
<FaInstagram className="text-xl" />
143-
</a>
144-
<a
145-
href="https://tlinz.com/discord"
146-
className="opacity-70 hover:opacity-100"
147-
aria-label="Join TanStack Discord"
148-
>
149-
<FaDiscord className="text-xl" />
150-
</a>
146+
{socialLinksData.map((link, index) => (
147+
<a
148+
key={index}
149+
href={link.href}
150+
className="transition-opacity duration-300 ease-in-out opacity-70 hover:opacity-100"
151+
aria-label={link.label}
152+
>
153+
{link.icon}
154+
</a>
155+
))}
151156
</div>
152157
)
153158

src/components/ThemeToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export function ThemeToggle() {
1818
onClick={handleToggleMode}
1919
className={`bg-gray-500/10 dark:bg-gray-500/30 rounded-lg flex items-center justify-between
2020
hover:bg-gray-500/20 dark:hover:bg-gray-500/40
21-
cursor-pointer transition-all text-xs font-black`}
21+
cursor-pointer transition-all duration-300 ease-in-out text-xs font-black`}
2222
>
2323
<div className="flex-1 flex items-center justify-between p-2 gap-1">
2424
<FaSun className={`hidden light:block`} />

0 commit comments

Comments
 (0)