mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-21 22:18:04 +02:00
feat(design): Warm Cinema theme + event-driven adaptive players
Replaces the Projector Noir palette with "Warm Cinema" and rebuilds the web players around a shared, event-driven engine. Design - app_colors: warm charcoal (#0B0908), cream (#F3E9DF), ember (#D9541F); adds posterScrim/heroScrim gradients, lift()/emberFocus() shadows, const cream-alpha tokens replacing Colors.whiteNN, and primaryFill, a deeper ember reserved for text-bearing fills so white labels clear the 4.5:1 AA threshold that #D9541F alone does not - app_theme / mobile_theme: Fraunces (display serif) + Karla (body), tighter radii, 20+ component themes - glass_container: opaque layered surfaces replace the blurred glass - themed_loading_screen restyled; players and boot splash follow Performance - drop every BackdropFilter: backdrop blur forced a full framebuffer read per frame per card, the main source of scroll jank - bundle Fraunces/Karla as assets so google_fonts stops fetching from fonts.gstatic.com at startup - bound image decode size on 12 sites: a 40-poster grid drops from ~240 MB to a few tens of MB of GPU memory Players (new shared engine: web/xf-player-core.js) - start on media events instead of polling the buffer every 100-200 ms - hls.js/mpegts.js loaded on demand, so ~213 KB of mpegts is never fetched for HLS streams - liveSyncDurationCount 10 -> 2, startFragPrefetch on, testBandwidth off, MPEG-TS initial stash 512 KB -> 64 KB - adaptive escalation fast -> balanced -> safe after repeated stalls in a 60 s window, applied live for HLS so there is no visible cut Preserved from the recent streaming work on main: server-side quality selection, stable player viewId, the turbo direct MPEG-TS path, vendored library cache headers and the CI/Docker changes. Only the theme layer and the player front-end were replaced; GlassCard stays in ui_components. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e332895d7d
commit
1feeaae78a
49 files changed
+2341
-1751
No files matched your search
@@ -1,12 +1,19 @@
|
||||
import 'dart:ui';
|
||||
import 'package:flutter/material.dart';
|
||||
import '../theme/app_colors.dart';
|
||||
|
||||
/// Glassmorphism container with 3 depth levels (Stitch Design System)
|
||||
/// Conteneur de surface « Warm Cinema » — 3 niveaux de profondeur.
|
||||
///
|
||||
/// Level 0: Pure base background (#0F1014), no blur.
|
||||
/// Level 1: Translucent layer with backdrop blur 20px, 1px border 10% white.
|
||||
/// Level 2: High-blur floating container with subtle inner glow in primary accent.
|
||||
/// Level 0 : socle brut (#0B0908), aucune ombre.
|
||||
/// Level 1 : plaque opaque légèrement éclaircie, liseré crème 8 %, ombre douce.
|
||||
/// Level 2 : bloc flottant, liseré ember sur l'arête haute, ombre profonde.
|
||||
///
|
||||
/// PERF : cette version n'utilise **aucun** `BackdropFilter`. Le flou de fond
|
||||
/// forçait Flutter Web à relire le framebuffer à chaque frame pour chaque
|
||||
/// carte à l'écran (33 sites d'appel ici) — cause principale du jank au
|
||||
/// scroll. La profondeur est désormais rendue par des surfaces opaques
|
||||
/// pré-teintées et des ombres, ce qui coûte quasiment rien au GPU.
|
||||
///
|
||||
/// L'API publique est inchangée : aucun site d'appel n'a besoin d'être modifié.
|
||||
enum GlassLevel { level0, level1, level2 }
|
||||
|
||||
class GlassContainer extends StatelessWidget {
|
||||
@@ -21,6 +28,14 @@ class GlassContainer extends StatelessWidget {
|
||||
final bool border;
|
||||
final List<BoxShadow>? boxShadow;
|
||||
|
||||
/// Alias de [border] (nom utilisé par les widgets de navigation TV).
|
||||
/// Prioritaire sur [border] lorsqu'il est fourni.
|
||||
final bool? hasBorder;
|
||||
|
||||
/// Passer `false` supprime toute ombre portée — utile pour les barres
|
||||
/// collées à un bord, où l'ombre créerait une couture visible.
|
||||
final bool showShadow;
|
||||
|
||||
const GlassContainer({
|
||||
super.key,
|
||||
required this.child,
|
||||
@@ -28,14 +43,18 @@ class GlassContainer extends StatelessWidget {
|
||||
this.height,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
this.margin,
|
||||
this.borderRadius = 16.0,
|
||||
this.borderRadius = 14.0,
|
||||
this.level = GlassLevel.level1,
|
||||
this.borderColor,
|
||||
this.border = true,
|
||||
this.boxShadow,
|
||||
this.hasBorder,
|
||||
this.showShadow = true,
|
||||
});
|
||||
|
||||
/// Convenience constructor for Level 0 (pure base)
|
||||
bool get _showBorder => hasBorder ?? border;
|
||||
|
||||
/// Niveau 0 — socle brut.
|
||||
const GlassContainer.base({
|
||||
super.key,
|
||||
required this.child,
|
||||
@@ -43,13 +62,15 @@ class GlassContainer extends StatelessWidget {
|
||||
this.height,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
this.margin,
|
||||
this.borderRadius = 16.0,
|
||||
this.borderRadius = 14.0,
|
||||
this.borderColor,
|
||||
this.border = false,
|
||||
this.boxShadow,
|
||||
this.hasBorder,
|
||||
this.showShadow = true,
|
||||
}) : level = GlassLevel.level0;
|
||||
|
||||
/// Convenience constructor for Level 1 (standard glass)
|
||||
/// Niveau 1 — plaque standard.
|
||||
const GlassContainer.glass({
|
||||
super.key,
|
||||
required this.child,
|
||||
@@ -57,13 +78,15 @@ class GlassContainer extends StatelessWidget {
|
||||
this.height,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
this.margin,
|
||||
this.borderRadius = 16.0,
|
||||
this.borderRadius = 14.0,
|
||||
this.borderColor,
|
||||
this.border = true,
|
||||
this.boxShadow,
|
||||
this.hasBorder,
|
||||
this.showShadow = true,
|
||||
}) : level = GlassLevel.level1;
|
||||
|
||||
/// Convenience constructor for Level 2 (floating with inner glow)
|
||||
/// Niveau 2 — bloc flottant (modales, panneaux, overlays).
|
||||
const GlassContainer.floating({
|
||||
super.key,
|
||||
required this.child,
|
||||
@@ -71,10 +94,12 @@ class GlassContainer extends StatelessWidget {
|
||||
this.height,
|
||||
this.padding = const EdgeInsets.all(16),
|
||||
this.margin,
|
||||
this.borderRadius = 24.0,
|
||||
this.borderRadius = 20.0,
|
||||
this.borderColor,
|
||||
this.border = true,
|
||||
this.boxShadow,
|
||||
this.hasBorder,
|
||||
this.showShadow = true,
|
||||
}) : level = GlassLevel.level2;
|
||||
|
||||
@override
|
||||
@@ -98,12 +123,13 @@ class GlassContainer extends StatelessWidget {
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.baseLevel0,
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
border: border
|
||||
border: _showBorder
|
||||
? Border.all(
|
||||
color: borderColor ?? Colors.transparent,
|
||||
width: 1,
|
||||
)
|
||||
: null,
|
||||
boxShadow: showShadow ? boxShadow : null,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
@@ -114,34 +140,29 @@ class GlassContainer extends StatelessWidget {
|
||||
width: width,
|
||||
height: height,
|
||||
margin: margin,
|
||||
child: ClipRRect(
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColors.glassLevel1Bg,
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 20, sigmaY: 20),
|
||||
child: Container(
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
color: AppColors.glassLevel1Bg,
|
||||
border: border
|
||||
? Border.all(
|
||||
color: borderColor ?? AppColors.glassLevel1Border,
|
||||
width: 1,
|
||||
)
|
||||
: null,
|
||||
boxShadow: boxShadow ??
|
||||
[
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.2),
|
||||
blurRadius: 20,
|
||||
spreadRadius: -5,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
),
|
||||
border: _showBorder
|
||||
? Border.all(
|
||||
color: borderColor ?? AppColors.glassLevel1Border,
|
||||
width: 1,
|
||||
)
|
||||
: null,
|
||||
boxShadow: !showShadow
|
||||
? null
|
||||
: boxShadow ??
|
||||
const [
|
||||
BoxShadow(
|
||||
color: Color(0x59000000), // noir 35 %
|
||||
blurRadius: 18,
|
||||
spreadRadius: -6,
|
||||
offset: Offset(0, 8),
|
||||
),
|
||||
],
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -150,54 +171,54 @@ class GlassContainer extends StatelessWidget {
|
||||
width: width,
|
||||
height: height,
|
||||
margin: margin,
|
||||
child: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
child: BackdropFilter(
|
||||
filter: ImageFilter.blur(sigmaX: 40, sigmaY: 40),
|
||||
child: Container(
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
color: AppColors.glassLevel2Bg,
|
||||
border: border
|
||||
? Border(
|
||||
top: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2InnerGlow,
|
||||
width: 1,
|
||||
),
|
||||
left: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2InnerGlow,
|
||||
width: 1,
|
||||
),
|
||||
right: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2Border,
|
||||
width: 1,
|
||||
),
|
||||
bottom: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2Border,
|
||||
width: 1,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
boxShadow: boxShadow ??
|
||||
[
|
||||
BoxShadow(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
blurRadius: 30,
|
||||
spreadRadius: -10,
|
||||
offset: const Offset(0, 10),
|
||||
),
|
||||
BoxShadow(
|
||||
color: AppColors.primary.withOpacity(0.1),
|
||||
blurRadius: 40,
|
||||
spreadRadius: -10,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: child,
|
||||
),
|
||||
padding: padding,
|
||||
decoration: BoxDecoration(
|
||||
// Dégradé très court : arête haute captant la « lumière du projecteur ».
|
||||
gradient: const LinearGradient(
|
||||
colors: [Color(0xFF262019), Color(0xFF1F1815)],
|
||||
stops: [0.0, 0.45],
|
||||
begin: Alignment.topCenter,
|
||||
end: Alignment.bottomCenter,
|
||||
),
|
||||
borderRadius: BorderRadius.circular(borderRadius),
|
||||
border: _showBorder
|
||||
? Border(
|
||||
top: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2InnerGlow,
|
||||
width: 1,
|
||||
),
|
||||
left: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2Border,
|
||||
width: 1,
|
||||
),
|
||||
right: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2Border,
|
||||
width: 1,
|
||||
),
|
||||
bottom: BorderSide(
|
||||
color: borderColor ?? AppColors.glassLevel2Border,
|
||||
width: 1,
|
||||
),
|
||||
)
|
||||
: null,
|
||||
boxShadow: !showShadow
|
||||
? null
|
||||
: boxShadow ??
|
||||
const [
|
||||
BoxShadow(
|
||||
color: Color(0xA6000000), // noir 65 %
|
||||
blurRadius: 40,
|
||||
spreadRadius: -12,
|
||||
offset: Offset(0, 20),
|
||||
),
|
||||
BoxShadow(
|
||||
color: Color(0x1FD9541F), // halo ember 12 %
|
||||
blurRadius: 48,
|
||||
spreadRadius: -18,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user