diff --git a/export.php b/export.php index 2f332fa..a79b8a8 100644 --- a/export.php +++ b/export.php @@ -156,6 +156,33 @@ function export_take_entries(array $entries, callable $filter, int $limit = 4): return $picked; } +function export_programme_label(array $programme): string { + if (export_programme_has_category($programme, ['document', 'docu', 'biopic', 'history', 'histoire'])) { + return 'Documentaire'; + } + if (export_programme_is_series($programme)) { + return 'Serie'; + } + if (export_programme_duration($programme) >= 80) { + return 'Film'; + } + return 'Selection'; +} + +function export_entry_tease(array $entry): string { + $programme = $entry['programme']; + if (!empty($programme['subtitle'])) { + return $programme['subtitle']; + } + if (!empty($programme['categories'])) { + return implode(' · ', array_slice($programme['categories'], 0, 3)); + } + if (!empty($programme['desc'])) { + return mb_strimwidth($programme['desc'], 0, 120, '…'); + } + return 'A suivre sur ' . $entry['channel_name']; +} + function export_build_magazine(array $channels): array { $all = []; foreach ($channels as $channel) { @@ -180,6 +207,11 @@ function export_build_magazine(array $channels): array { $movies = export_take_entries($all, static fn($entry) => !export_programme_is_series($entry['programme']) && export_programme_duration($entry['programme']) >= 80, 4); $late_picks = export_take_entries($all, static fn($entry) => (int) $entry['programme']['start']->format('H') >= 21, 4); $docs = export_take_entries($all, static fn($entry) => export_programme_has_category($entry['programme'], ['document', 'biopic', 'history', 'histoire']), 4); + $premieres = export_take_entries( + $all, + static fn($entry) => export_programme_is_series($entry['programme']) && !empty($entry['programme']['subtitle']), + 4 + ); $by_channel = []; foreach ($channels as $channel) { @@ -190,30 +222,45 @@ function export_build_magazine(array $channels): array { ]; } - $cards = [ + $sections = [ [ + 'slug' => 'top-picks', 'title' => 'Ce soir a la tele', 'kicker' => 'Selection de la redaction', + 'intro' => 'Les programmes qui donnent envie de garder la tele allumee ce soir.', 'items' => array_slice($highlights, 0, 4), ], [ - 'title' => 'Series en diffusion', + 'slug' => 'series', + 'title' => 'Nouvelles series diffusees', 'kicker' => 'Episodes et rendez-vous', - 'items' => $series ?: array_slice($highlights, 0, 4), + 'intro' => 'Les feuilletons, rediffusions premium et lancements du moment.', + 'items' => $premieres ?: ($series ?: array_slice($highlights, 0, 4)), ], [ + 'slug' => 'movies', 'title' => 'Films de la selection', 'kicker' => 'Longs formats', + 'intro' => 'Le bloc cinema de la journee, entre classiques, blockbusters et belles surprises.', 'items' => $movies ?: array_slice($highlights, 0, 4), ], [ + 'slug' => 'docs', 'title' => 'Docs et recits de vie', 'kicker' => 'Documentaires / biopics', + 'intro' => 'Pour les amateurs de recits, d histoires vraies et de programmes a contexte.', 'items' => $docs ?: $late_picks ?: array_slice($highlights, 0, 4), ], + [ + 'slug' => 'prime', + 'title' => 'Prime time', + 'kicker' => 'A partir de 21h', + 'intro' => 'Les rendez-vous les plus costauds de la tranche du soir.', + 'items' => $late_picks ?: array_slice($highlights, 0, 4), + ], ]; - return ['highlights' => $highlights, 'channels' => $by_channel, 'cards' => $cards]; + return ['lead' => $highlights[0] ?? null, 'highlights' => $highlights, 'channels' => $by_channel, 'sections' => $sections]; } $sources = array_values($config['epg_sources'] ?? []); @@ -302,7 +349,7 @@ $magazine = export_build_magazine($visible_channels); .mag-title{font-family:'IM Fell English',serif;font-size:38px;line-height:1.02;margin-bottom:10px} .mag-meta{font-family:'Share Tech Mono',monospace;font-size:11px;color:var(--ink-soft);letter-spacing:.04em;margin-bottom:10px} .mag-desc{font-size:14px;line-height:1.45;color:var(--ink-soft)} -.mag-side-list,.mag-channels,.mag-cards{display:grid;gap:14px} +.mag-side-list,.mag-channels,.mag-sections{display:grid;gap:14px} .mag-mini-title{font-size:18px;font-weight:700;line-height:1.08} .mag-mini{padding-top:12px;border-top:1px dashed var(--line)} .mag-mini:first-child{padding-top:0;border-top:none} @@ -315,9 +362,25 @@ $magazine = export_build_magazine($visible_channels); .mag-item:first-child{padding-top:0;border-top:none} .mag-time{font-family:'Share Tech Mono',monospace;font-size:11px;color:var(--accent-2)} .mag-item-title{font-size:15px;font-weight:700;line-height:1.08} -.mag-card{background:rgba(255,255,255,.35);border:1px solid var(--line);padding:14px} -.mag-cards{grid-template-columns:repeat(2,minmax(0,1fr))} -.mag-card.featured{background:linear-gradient(180deg,rgba(170,66,49,.12),rgba(255,255,255,.35))} +.mag-sections{grid-template-columns:repeat(2,minmax(0,1fr))} +.mag-section{background:rgba(255,255,255,.48);border:1px solid var(--line);padding:18px;position:relative;overflow:hidden} +.mag-section::before{content:'';position:absolute;left:0;top:0;bottom:0;width:6px;background:linear-gradient(180deg,var(--accent),rgba(170,66,49,.1))} +.mag-section.featured{background:linear-gradient(180deg,rgba(170,66,49,.16),rgba(255,255,255,.48))} +.mag-section-head{padding-left:8px;margin-bottom:12px} +.mag-section-title{font-family:'IM Fell English',serif;font-size:32px;line-height:1;margin:0 0 8px} +.mag-section-intro{font-size:13px;line-height:1.45;color:var(--ink-soft);max-width:44ch} +.mag-spotlight{display:grid;grid-template-columns:110px 1fr;gap:14px;padding:14px 0;border-top:1px solid rgba(38,70,83,.15);border-bottom:1px solid rgba(38,70,83,.15);margin-bottom:12px} +.mag-spotlight-time{font-family:'Share Tech Mono',monospace;font-size:12px;color:var(--accent-2);letter-spacing:.06em} +.mag-badge{display:inline-flex;align-items:center;padding:4px 8px;background:#f1dfc2;color:#5f2e20;font-family:'Share Tech Mono',monospace;font-size:10px;letter-spacing:.08em;text-transform:uppercase;border:1px solid rgba(170,66,49,.22);margin-bottom:8px} +.mag-spotlight-title{font-size:24px;font-weight:700;line-height:1.03;margin-bottom:6px} +.mag-spotlight-tease{font-size:13px;line-height:1.45;color:var(--ink-soft)} +.mag-briefs{display:grid;gap:10px} +.mag-brief{display:grid;grid-template-columns:74px 1fr;gap:10px;padding-top:10px;border-top:1px dashed var(--line)} +.mag-brief:first-child{padding-top:0;border-top:none} +.mag-brief-time{font-family:'Share Tech Mono',monospace;font-size:11px;color:var(--accent-2)} +.mag-brief-title{font-size:16px;font-weight:700;line-height:1.08} +.mag-brief-tease{font-size:12px;color:var(--ink-soft);line-height:1.35;margin-top:2px} +.mag-footer-title{margin-top:8px} .timeline-wrap{display:grid;gap:14px} .timeline-row{display:grid;grid-template-columns:180px 1fr;gap:14px;align-items:stretch} .timeline-channel{border-top:2px solid var(--accent-2);padding-top:8px} @@ -329,7 +392,7 @@ $magazine = export_build_magazine($visible_channels); .mini-title{font-size:13px;font-weight:700;line-height:1.05} .mini-meta{font-family:'Share Tech Mono',monospace;font-size:10px;color:var(--ink-soft);margin-top:3px} @media print{body{background:#fff}.page{padding:0}.toolbar{display:none}.sheet{box-shadow:none;border:none;width:auto;margin:0}.sheet-wrap{overflow:visible}.cards-grid{grid-template-columns:1fr 1fr}} -@media (max-width:1200px){.sheet{width:100%}.cards-grid,.mag-channels,.mag-hero,.mag-cards,.mag-banner{grid-template-columns:1fr}.timeline-row{grid-template-columns:1fr}.timeline-grid{overflow:auto}} +@media (max-width:1200px){.sheet{width:100%}.cards-grid,.mag-channels,.mag-hero,.mag-sections,.mag-banner,.mag-spotlight{grid-template-columns:1fr}.timeline-row{grid-template-columns:1fr}.timeline-grid{overflow:auto}} @@ -481,7 +544,7 @@ $items = array_values(array_filter($channel['programmes'], static fn($p) => $p['
Cover story
- +
· format('H:i') . ' - ' . $p['stop']->format('H:i')) ?>
@@ -504,7 +567,44 @@ $items = array_values(array_filter($channel['programmes'], static fn($p) => $p['
-
Channel picks
+
Nos cartes editoriales
+
+ $section): ?> +
+
+
+

+
+
+ + +
+
format('H:i')) ?>
format('H:i')) ?>
+
+
+
+
+
+
+
+ +
+ +
+
format('H:i')) ?>
+
+
+
+
+
+
+ +
+
+ +
+ +
@@ -513,36 +613,18 @@ $items = array_values(array_filter($channel['programmes'], static fn($p) => $p['
- +
format('H:i')) ?>
format('H:i')) ?>
-
+
- - - -
Magazine cards
-
- -
-
-
- -
-
-
· format('H:i') . ' - ' . $p['stop']->format('H:i')) ?>
-
-
-
- -