Some checks failed
build-images / web (push) Has been cancelled
vision2026-ci / Python SDK resource tests (push) Has been cancelled
build-images / api (push) Has been cancelled
build-images / worker-gpu (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (comfy-workflow-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (effects-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (eventbus-types) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (growth-analytics) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (provider-adapter-kit) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (publishing-connectors) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (render-core) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (shot-template-schema) (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (trends-schema) (push) Has been cancelled
vision2026-ci / Desktop engine crates (test + clippy + fmt) (push) Has been cancelled
codeql / Analyze (javascript-typescript) (push) Has been cancelled
codeql / Analyze (python) (push) Has been cancelled
perf / API hot-path micro-smoke (budgeted) (push) Has been cancelled
perf / Desktop engine crates (release build check) (push) Has been cancelled
vision2026-ci / API phase modules (ruff + pytest) (push) Has been cancelled
vision2026-ci / Alembic upgrade + drift check (push) Has been cancelled
vision2026-ci / Shared packages (TS≡Python golden parity) (caption-engine) (push) Has been cancelled
Paid, hosted product at menivor.com, now retired as a company project. Fresh squashed history of the cleaned working tree (secret-scanned, no .env, no customer data, no outreach logs). Built on MoneyPrinterTurbo (MIT, harry0703) — see NOTICE.
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { cn } from "@/lib/utils";
|
|
import { showcaseCredit, type ShowcaseMedia } from "@/lib/styles/showcase";
|
|
import { useInViewPlayback } from "./useInViewPlayback";
|
|
|
|
/**
|
|
* A hero reel: muted, looping, playing while visible. Poster first: the loop
|
|
* is attached only once the reel is on screen, so the poster (preloaded by the
|
|
* page for the lead reel) is the first paint.
|
|
*/
|
|
export function HeroReel({
|
|
reel,
|
|
priority = false,
|
|
className,
|
|
}: Readonly<{ reel: ShowcaseMedia; priority?: boolean; className?: string }>) {
|
|
const { ref } = useInViewPlayback<HTMLVideoElement>({
|
|
src: reel.mp4,
|
|
fallbackSrc: reel.fallbackMp4,
|
|
fallbackPoster: reel.fallbackPoster,
|
|
rootMargin: "0px",
|
|
threshold: 0.05,
|
|
});
|
|
return (
|
|
<div className={cn("relative overflow-hidden bg-black", className)}>
|
|
<video
|
|
ref={ref}
|
|
muted
|
|
loop
|
|
playsInline
|
|
preload={priority ? "auto" : "none"}
|
|
poster={reel.poster}
|
|
data-showcase-key={reel.key}
|
|
aria-label={`${reel.label}: ${reel.niche}. ${showcaseCredit(reel)}.`}
|
|
className="size-full object-cover"
|
|
/>
|
|
{/* Visible proof for sighted users: the wall tiles already carry this
|
|
credit in a figcaption, but the hero (highest-prominence, instant
|
|
autoplay) only had it in aria-label. `aria-hidden` avoids a second,
|
|
redundant screen-reader announcement. */}
|
|
<span
|
|
aria-hidden
|
|
className="pointer-events-none absolute bottom-2.5 left-2.5 max-w-[calc(100%-1.25rem)] truncate rounded-full bg-black/60 px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide text-white/90 backdrop-blur-sm sm:text-[11px]"
|
|
>
|
|
{showcaseCredit(reel)}
|
|
</span>
|
|
</div>
|
|
);
|
|
}
|