Skip to content

Commit c5d03a8

Browse files
feat(webapp): add intentional header logo motion
1 parent 3b88b77 commit c5d03a8

1 file changed

Lines changed: 19 additions & 4 deletions

File tree

webapp/src/components/core/Header.tsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { TagIcon } from "@primer/octicons-react";
22
import { Link } from "@tanstack/react-router";
33
import { LogOut, Settings, User } from "lucide-react";
4+
import { motion, useReducedMotion } from "motion/react";
45

56
import { SignInButtons } from "@/components/auth/SignInButtons";
67
import { HephaestusLogo } from "@/components/brand/HephaestusLogo";
@@ -63,6 +64,20 @@ export default function Header({
6364
const hasWorkspace = Boolean(workspaceSlug);
6465
const hasUsername = Boolean(username);
6566
const badge = resolveHeaderBadge(version, environmentName, isProduction);
67+
const reduceMotion = useReducedMotion();
68+
const logo = (
69+
<motion.span
70+
className="inline-flex"
71+
whileHover={reduceMotion ? undefined : { y: -1, scale: 1.01 }}
72+
whileTap={reduceMotion ? undefined : { scale: 0.98 }}
73+
transition={{ type: "spring", stiffness: 500, damping: 30, mass: 0.4 }}
74+
>
75+
<HephaestusLogo
76+
markClassName="size-8 origin-center transition-transform duration-200 ease-out group-hover/logo:-rotate-3 group-hover/logo:scale-105 motion-reduce:transform-none"
77+
wordmarkClassName="hidden text-xl sm:inline"
78+
/>
79+
</motion.span>
80+
);
6681

6782
return (
6883
<header className="flex h-16 shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12 justify-between">
@@ -74,17 +89,17 @@ export default function Header({
7489
to="/w/$workspaceSlug"
7590
params={{ workspaceSlug: workspaceSlug ?? "" }}
7691
aria-label="Hephaestus home"
77-
className="flex gap-2 items-center hover:text-muted-foreground"
92+
className="group/logo flex items-center gap-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
7893
>
79-
<HephaestusLogo wordmarkClassName="hidden text-xl sm:inline" />
94+
{logo}
8095
</Link>
8196
) : (
8297
<Link
8398
to="/"
8499
aria-label="Hephaestus home"
85-
className="flex gap-2 items-center hover:text-muted-foreground"
100+
className="group/logo flex items-center gap-2 rounded-md outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
86101
>
87-
<HephaestusLogo wordmarkClassName="hidden text-xl sm:inline" />
102+
{logo}
88103
</Link>
89104
)}
90105
{badge.kind === "release" ? (

0 commit comments

Comments
 (0)