Keep horizontal header logo; fix oversized stretch scaling.
Replace the 235% zoom hack with header-slot height and object-contain so aspect ratio stays correct. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
cf29d44ff8
commit
2f80b96a95
2 files changed
+44
-2
No files matched your search
@@ -4,6 +4,8 @@ import { cn } from "@/lib/utils";
|
|||||||
|
|
||||||
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
|
/** Faculty seal mark (transparent). Source: MST icon with side text removed. */
|
||||||
const MARK_SRC = "/brand/mst-faculty.png";
|
const MARK_SRC = "/brand/mst-faculty.png";
|
||||||
|
/** Horizontal wordmark with faculty + university name baked in. */
|
||||||
|
const HORIZONTAL_SRC = "/MstAutIcon_horizontal.png";
|
||||||
|
|
||||||
type BrandLogoProps = {
|
type BrandLogoProps = {
|
||||||
href?: string;
|
href?: string;
|
||||||
@@ -12,9 +14,14 @@ type BrandLogoProps = {
|
|||||||
onDark?: boolean;
|
onDark?: boolean;
|
||||||
className?: string;
|
className?: string;
|
||||||
compact?: boolean;
|
compact?: boolean;
|
||||||
|
/**
|
||||||
|
* Header wordmark: uses the horizontal logo (text is in the image).
|
||||||
|
* Title/subtitle are not rendered — only used for aria-label.
|
||||||
|
*/
|
||||||
|
horizontal?: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
/** AUT seal — mark + title/subtitle text (agreed header size). */
|
/** AUT brand mark / horizontal wordmark. */
|
||||||
export function BrandLogo({
|
export function BrandLogo({
|
||||||
href = "/",
|
href = "/",
|
||||||
title,
|
title,
|
||||||
@@ -22,7 +29,40 @@ export function BrandLogo({
|
|||||||
onDark = false,
|
onDark = false,
|
||||||
className,
|
className,
|
||||||
compact = false,
|
compact = false,
|
||||||
|
horizontal = false,
|
||||||
}: BrandLogoProps) {
|
}: BrandLogoProps) {
|
||||||
|
const ariaLabel = [title, subtitle].filter(Boolean).join(" — ");
|
||||||
|
|
||||||
|
if (horizontal) {
|
||||||
|
return (
|
||||||
|
<Link
|
||||||
|
href={href}
|
||||||
|
className={cn(
|
||||||
|
"group inline-flex shrink-0 items-center",
|
||||||
|
// Fit inside header bar — never scale above the slot (no 200%+ zoom).
|
||||||
|
compact ? "h-10" : "h-11 sm:h-12",
|
||||||
|
className,
|
||||||
|
)}
|
||||||
|
aria-label={ariaLabel}
|
||||||
|
>
|
||||||
|
<Image
|
||||||
|
src={HORIZONTAL_SRC}
|
||||||
|
alt={ariaLabel}
|
||||||
|
width={1888}
|
||||||
|
height={607}
|
||||||
|
priority
|
||||||
|
sizes="(max-width:640px) 200px, 260px"
|
||||||
|
className={cn(
|
||||||
|
// Preserve intrinsic aspect ratio; constrain width so nav stays usable.
|
||||||
|
"h-full w-auto max-w-[13.5rem] object-contain object-right sm:max-w-[17rem]",
|
||||||
|
// Asset is white-on-black; blend so the plate disappears into the header.
|
||||||
|
onDark ? "mix-blend-screen" : "invert mix-blend-multiply",
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
</Link>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={href}
|
href={href}
|
||||||
@@ -30,7 +70,7 @@ export function BrandLogo({
|
|||||||
"group flex min-w-0 items-center gap-2.5 sm:gap-3",
|
"group flex min-w-0 items-center gap-2.5 sm:gap-3",
|
||||||
className,
|
className,
|
||||||
)}
|
)}
|
||||||
aria-label={[title, subtitle].filter(Boolean).join(" — ")}
|
aria-label={ariaLabel}
|
||||||
>
|
>
|
||||||
<span
|
<span
|
||||||
className={cn(
|
className={cn(
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ export function SiteHeader({
|
|||||||
title={brandTitle}
|
title={brandTitle}
|
||||||
subtitle={brandSubtitle}
|
subtitle={brandSubtitle}
|
||||||
onDark={isDark}
|
onDark={isDark}
|
||||||
|
horizontal
|
||||||
className="shrink-0"
|
className="shrink-0"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
@@ -213,6 +214,7 @@ export function SiteHeader({
|
|||||||
title={brandTitle}
|
title={brandTitle}
|
||||||
subtitle={brandSubtitle}
|
subtitle={brandSubtitle}
|
||||||
onDark
|
onDark
|
||||||
|
horizontal
|
||||||
compact
|
compact
|
||||||
className="shrink-0"
|
className="shrink-0"
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user