UI-UX/src/components/Logo.tsx
iye 74a7b0ea16
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 4m21s
feat(ui): polish hero/logo/cards + bump TOS version + drop missing-video flags
- Hero eyebrow: "Top 12 · Virtual Idol Debut Project"
  → "Top 12 · Cyber Star Debut Survival"
- Hero video: attempt unmuted autoplay first, fall back to muted on
  browser autoplay-policy block (sound button reflects actual state).
- Logo: replace with cropped v2 art, drop purple drop-shadow glow.
- ArtistCard: drop non-top12 opacity dim AND the top dark gradient
  overlay — new high-quality portraits look better fully exposed.
- mock-data: 003/010/017/027/033 solo videos are present in v2,
  cleared MISSING_VIDEO set so the video section renders for them.
- tos: bump TOS_VERSION to 3 — videos/portraits overwritten on TOS,
  this cache-busts older URLs in browsers and CDNs.

TOS uploads (handled separately): hero-pv.mp4, 5 solo videos
(003/010/017/027/033), 7 cover images, 6/036 atmosphere images.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-15 17:02:29 +08:00

56 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import Link from "next/link";
type LogoSize = "sm" | "md" | "lg" | "xl";
interface LogoProps {
size?: LogoSize;
href?: string | null;
className?: string;
}
// 高度由 size 控制,宽度按 logo.png 实际比例(约 5.41:1单行 CYBER STAR + 星环)自适应
const HEIGHT_PX: Record<LogoSize, number> = {
sm: 24,
md: 44,
lg: 64,
xl: 88,
};
export default function Logo({
size = "md",
href = "/",
className = "",
}: LogoProps) {
const h = HEIGHT_PX[size];
// 用原生 <img> 绕开 Next/Image 的格式转换 —— 某些环境下 sharp 把透明 PNG
// 转 webp/avif 时会铺白底,导致 logo 在深色 nav 上出现白色矩形。
// ?v=2 缓存破坏:logo 改版时 +1,浏览器立刻拉新版而不读老缓存。
const inner = (
<img
src="/logo.png?v=3"
alt="CYBER STAR"
decoding="async"
draggable={false}
style={{
height: `${h}px`,
width: "auto",
background: "transparent",
}}
className={`block select-none ${className}`}
/>
);
if (!href) return inner;
return (
<Link
href={href}
className="inline-flex items-center hover:opacity-90 transition-opacity"
aria-label="CYBER STAR · 首页"
style={{ background: "transparent" }}
>
{inner}
</Link>
);
}