Add live show player playback and effects
Some checks failed
linter / quality (push) Has been cancelled
tests / ci (push) Has been cancelled
tests / ui (push) Has been cancelled

This commit is contained in:
Codex Agent
2026-01-05 18:31:01 +01:00
parent 11dc0d77b4
commit 53eb560aa5
17 changed files with 1612 additions and 2 deletions

View File

@@ -0,0 +1,69 @@
import React from 'react';
import type { LiveShowBackgroundMode, LiveShowPhoto } from '../services/liveShowApi';
function resolvePhotoUrl(photo?: LiveShowPhoto | null): string | null {
if (!photo) {
return null;
}
return photo.full_url || photo.thumb_url || null;
}
function resolveBlurAmount(intensity: number): number {
const safe = Number.isFinite(intensity) ? intensity : 70;
return 28 + Math.min(60, Math.max(0, safe)) * 0.45;
}
export default function LiveShowBackdrop({
mode,
photo,
intensity,
}: {
mode: LiveShowBackgroundMode;
photo?: LiveShowPhoto | null;
intensity: number;
}) {
const photoUrl = resolvePhotoUrl(photo);
const blurAmount = resolveBlurAmount(intensity);
const fallbackMode = mode === 'blur_last' && !photoUrl ? 'gradient' : mode;
if (fallbackMode === 'solid') {
return (
<div
className="pointer-events-none absolute inset-0 z-0"
style={{ backgroundColor: 'rgb(8, 10, 16)' }}
/>
);
}
if (fallbackMode === 'gradient') {
return <div className="pointer-events-none absolute inset-0 z-0 bg-aurora-enhanced" />;
}
if (fallbackMode === 'brand') {
return (
<div
className="pointer-events-none absolute inset-0 z-0"
style={{
backgroundImage:
'radial-gradient(120% 120% at 15% 15%, var(--guest-primary) 0%, rgba(0,0,0,0.8) 55%), radial-gradient(120% 120% at 85% 20%, var(--guest-secondary) 0%, transparent 60%)',
backgroundColor: 'rgb(5, 8, 16)',
}}
/>
);
}
return (
<div className="pointer-events-none absolute inset-0 z-0">
<div
className="absolute inset-0 scale-110"
style={{
backgroundImage: photoUrl ? `url(${photoUrl})` : undefined,
backgroundSize: 'cover',
backgroundPosition: 'center',
filter: `blur(${blurAmount}px) saturate(1.15)`,
}}
/>
<div className="absolute inset-0 bg-black/60" />
</div>
);
}