Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd91104970 |
No files matched your search
@@ -338,6 +338,8 @@ ## 13. Premium-Karten (Brand-UI-Kit v1.7, ADR-39)
|
||||
|
||||
**Video im Einstieg (Hero, Variante `photo_split`).** Optional `refs.video`: ein Film aus dem Medienmanager (Auswahl über `HeroVideo`, geprüft: Film, nicht archiviert, nicht gesperrt, keine Traineranleitung). Gespielt wird der freigegebene Clip nach der Regel der Karte (`CardClip`: Trailer, Vorschauclip, sonst die freigegebene Website-Datei des Films). Das Video liegt stumm auf der Fläche des Fotos, startet nach dem Laden von selbst (nicht bei „reduzierte Bewegung“, Datensparmodus, 2G), hat eine Schaltfläche zum Anhalten und fällt bei Fehlern auf das Foto zurück; `resources/js/hero-video.js`. Die Markenfläche zeigt kein Video. Entscheidung: ADR-43 (Nachtrag).
|
||||
|
||||
**Abspiel-Schaltfläche (Einstieg, Medien-, Programm-, Modul- und Bild-und-Text-Karte).** Gleich gestaltet in beiden Bausteinen (`lf-hero.css`, `lf-premium-card.css`): Solange der Clip nicht läuft, sitzt sie als großer Kreis (Karte 48–80 px nach Bildbreite, Einstieg 64–96 px) mit halbtransparentem Navy-Hintergrund und weißem Ring mittig auf dem Vorschaubild. Im Einstieg liegt die Mitte auf der Bildseite rechts neben dem Text; in der schmalen Darstellung (unter 860 px, Bild 16:9 über dem Text) mittig auf dem Bild. Läuft der Clip, wird daraus die kleine „Anhalten“-Schaltfläche oben rechts (44 px Trefferfläche, WCAG 2.2.2), damit sie das Bild nicht verdeckt. Skripte, Beschriftungen (`aria-label`, `aria-pressed`), Tastaturbedienung (echte Schaltfläche, sichtbarer Fokus) und das Verhalten bei „reduzierte Bewegung“ sind unverändert; dort entfällt die Animation der Schaltfläche. Test: `VideoPlayButtonTest`.
|
||||
|
||||
**Karte ohne Texte (Medien-, Programm- und Modulkarte).** Einstellung `settings.show_body` (`yes` Vorgabe, `no`; Darstellung → „Texte auf der Karte“). Bei `no` zeigt die Karte nur Bild oder Video: ohne Titel, Text, Art, Zusatzangaben, Aktion und Marke im Bild, immer Bild über dem (leeren) Textbereich. Der Titel bleibt als `visually-hidden`-Überschrift für Hilfstechnik, ein Trailer läuft weiter, die Redaktionsvorschau zeigt ihre Hinweise weiter. Die Themenkarte hat die Einstellung nicht (sie bliebe leer).
|
||||
|
||||
**Trailer auf der Karte (Medien-, Programm- und Modulkarte).** Einstellung `settings.clip` (`yes` Vorgabe, `no`). Der Clip ist der Trailer des Objekts (Präsentationsrolle „Trailer“, sonst „Vorschauclip“, bei einem Film ersatzweise sein freigegebener Teaser), nur wenn er für die Website freigegeben ist (`CardClip`). Er liegt über dem Kartenbild: Beim Überfahren mit der Maus läuft eine stumme Vorschau in Schleife; ein Klick oder Tipp (Handy) auf das Bild oder die kleine Schaltfläche (auch per Tastatur) spielt ihn mit Ton ab; `resources/js/card-clip.js`. Ohne Freigabe bleibt das Bild; die Redaktionsvorschau nennt den Grund. Entscheidung: ADR-43.
|
||||
|
||||
@@ -70,31 +70,65 @@ .lf-hero__video {
|
||||
|
||||
.lf-hero.is-hero-started .lf-hero__video { opacity: 1; }
|
||||
|
||||
/*
|
||||
* Abspiel-Schaltfläche: Solange der Clip nicht läuft, sitzt sie groß und halbtransparent mittig auf dem Vorschaubild
|
||||
* (rechts neben dem Text, in der schmalen Darstellung mittig auf dem Bild oberhalb des Textes). Läuft der Clip,
|
||||
* wandert sie als kleine „Video anhalten“-Schaltfläche in die Ecke (WCAG 2.2.2), damit sie das Bild nicht verdeckt.
|
||||
* Gleiche Gestaltung wie auf den Karten (.lf-pc__clip-toggle).
|
||||
*/
|
||||
.lf-hero__video-toggle {
|
||||
position: absolute;
|
||||
inset: 12px 12px auto auto;
|
||||
inset-block-start: 50%;
|
||||
inset-inline-start: 72%;
|
||||
z-index: 2;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 6px;
|
||||
min-block-size: 44px;
|
||||
padding: 8px 14px 8px 10px;
|
||||
inline-size: clamp(64px, 9cqi, 96px);
|
||||
block-size: clamp(64px, 9cqi, 96px);
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 999px;
|
||||
border-radius: 50%;
|
||||
color: #fff;
|
||||
background: rgb(3 37 81 / 86%);
|
||||
background: rgb(3 37 81 / 62%);
|
||||
box-shadow: 0 0 0 2px rgb(255 255 255 / 70%), 0 6px 24px rgb(3 37 81 / 35%);
|
||||
font: 600 0.8125rem/1.2 var(--lf-font-ui, system-ui, sans-serif);
|
||||
cursor: pointer;
|
||||
transform: translate(-50%, -50%);
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.lf-hero__video-toggle[hidden] { display: none; }
|
||||
.lf-hero__video-toggle:hover { background: var(--lf-navy-deep, var(--lf-hero-navy)); }
|
||||
.lf-hero__video-toggle:focus-visible { outline: 3px solid var(--lf-hero-yellow); outline-offset: 3px; }
|
||||
.lf-hero__video-icon { inline-size: 20px; block-size: 20px; }
|
||||
.lf-hero__video-toggle:hover { background: rgb(3 37 81 / 82%); transform: translate(-50%, -50%) scale(1.06); }
|
||||
.lf-hero__video-toggle:focus-visible { outline: 3px solid var(--lf-hero-yellow); outline-offset: 4px; }
|
||||
.lf-hero__video-icon { inline-size: 44%; block-size: 44%; }
|
||||
/* Das Dreieck sitzt optisch etwas links; ein kleiner Versatz zentriert es im Kreis. */
|
||||
.lf-hero__video-play { transform: translateX(1px); }
|
||||
.lf-hero__video-label { display: none; }
|
||||
.lf-hero__video-pause,
|
||||
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-play { display: none; }
|
||||
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-pause { display: inline; }
|
||||
|
||||
/* Läuft der Clip: kleine Schaltfläche oben rechts, mit 44 px Trefferfläche. */
|
||||
.lf-hero__video-toggle[aria-pressed="true"] {
|
||||
inset-block-start: 12px;
|
||||
inset-inline-start: auto;
|
||||
inset-inline-end: 12px;
|
||||
inline-size: auto;
|
||||
block-size: auto;
|
||||
min-block-size: 44px;
|
||||
padding: 8px 14px 8px 10px;
|
||||
border-radius: 999px;
|
||||
background: rgb(3 37 81 / 62%);
|
||||
box-shadow: 0 0 0 1px rgb(255 255 255 / 40%);
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.lf-hero__video-toggle[aria-pressed="true"]:hover { background: rgb(3 37 81 / 86%); transform: none; }
|
||||
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-icon { inline-size: 20px; block-size: 20px; }
|
||||
.lf-hero__video-toggle[aria-pressed="true"] .lf-hero__video-label { display: inline; }
|
||||
|
||||
.lf-hero--photo-split::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
@@ -237,6 +271,8 @@ @container lf-hero (max-width: 859.99px) {
|
||||
.lf-hero--height-large { min-block-size: 0; }
|
||||
.lf-hero__photo { position: relative; display: block; block-size: auto; aspect-ratio: 16 / 9; }
|
||||
.lf-hero__video { inset: 0 0 auto 0; block-size: auto; aspect-ratio: 16 / 9; border-radius: inherit; }
|
||||
/* Das Bild liegt oben im Format 16:9: Mitte = halbe Breite, halbe Bildhöhe. */
|
||||
.lf-hero__video-toggle:not([aria-pressed="true"]) { inset-block-start: calc(100cqi * 9 / 32); inset-inline-start: 50%; inline-size: clamp(56px, 16cqi, 80px); block-size: clamp(56px, 16cqi, 80px); }
|
||||
.lf-hero--photo-split::before { display: none; }
|
||||
.lf-hero__inner { padding: clamp(var(--pad-card), 3.5cqi, calc(var(--pad-card) * 1.6)); padding-block-end: calc(var(--pad-card) * 1.6); }
|
||||
.lf-hero__copy { max-inline-size: 100%; }
|
||||
@@ -253,6 +289,8 @@ @container lf-hero (max-width: 440px) {
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.lf-hero__video { transition: none; }
|
||||
.lf-hero__video-toggle { transition: none; }
|
||||
.lf-hero__video-toggle:hover { transform: translate(-50%, -50%); }
|
||||
.lf-hero__button { transition: none; }
|
||||
.lf-hero__button:hover { transform: none; }
|
||||
}
|
||||
@@ -393,47 +393,52 @@ .is-clip-playing > .lf-pc__clip {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Abspiel-Schaltfläche: groß und halbtransparent mittig auf dem Vorschaubild; die Größe folgt der Breite des Bildes
|
||||
* (schmale Karte 48 px, breite bis 80 px). Läuft der Clip, wird sie zur kleinen „Anhalten“-Schaltfläche oben rechts, damit
|
||||
* sie das Bild nicht verdeckt. Gleiche Gestaltung wie im Einstieg (.lf-hero__video-toggle).
|
||||
*/
|
||||
.lf-pc__clip-toggle {
|
||||
position: absolute;
|
||||
inset: 8px 8px auto auto;
|
||||
inset: 50% auto auto 50%;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
inline-size: 30px;
|
||||
block-size: 30px;
|
||||
inline-size: clamp(48px, 24%, 80px);
|
||||
aspect-ratio: 1;
|
||||
padding: 0;
|
||||
border: 0;
|
||||
border-radius: 50%;
|
||||
color: var(--lf-white);
|
||||
background: rgb(3 37 81 / 62%);
|
||||
box-shadow: 0 0 0 1px rgb(255 255 255 / 40%);
|
||||
box-shadow: 0 0 0 2px rgb(255 255 255 / 70%), 0 6px 24px rgb(3 37 81 / 35%);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
/* Klein im Bild, aber mit 44 px Trefferfläche für Finger und Zeiger. */
|
||||
.lf-pc__clip-toggle::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -7px;
|
||||
transform: translate(-50%, -50%);
|
||||
transition: background-color 0.2s ease, transform 0.2s ease;
|
||||
}
|
||||
|
||||
.is-clip-ready > .lf-pc__clip-toggle {
|
||||
display: inline-flex;
|
||||
}
|
||||
|
||||
.lf-pc__clip-toggle:hover,
|
||||
.lf-pc__clip-toggle[aria-pressed="true"] {
|
||||
background: var(--lf-navy-deep, var(--lf-navy));
|
||||
.lf-pc__clip-toggle:hover {
|
||||
background: rgb(3 37 81 / 82%);
|
||||
transform: translate(-50%, -50%) scale(1.06);
|
||||
}
|
||||
|
||||
.lf-pc__clip-toggle:focus-visible {
|
||||
outline: 3px solid var(--color-focus);
|
||||
outline-offset: 3px;
|
||||
outline-offset: 4px;
|
||||
}
|
||||
|
||||
.lf-pc__clip-icon {
|
||||
inline-size: 16px;
|
||||
block-size: 16px;
|
||||
inline-size: 44%;
|
||||
block-size: 44%;
|
||||
}
|
||||
|
||||
/* Das Dreieck sitzt optisch etwas links; ein kleiner Versatz zentriert es im Kreis. */
|
||||
.lf-pc__clip-play {
|
||||
transform: translateX(1px);
|
||||
}
|
||||
|
||||
.lf-pc__clip-pause,
|
||||
@@ -445,11 +450,37 @@ .lf-pc__clip-toggle[aria-pressed="true"] .lf-pc__clip-pause {
|
||||
display: inline;
|
||||
}
|
||||
|
||||
/* Läuft der Clip: kleine Schaltfläche oben rechts, mit 44 px Trefferfläche. */
|
||||
.lf-pc__clip-toggle[aria-pressed="true"] {
|
||||
inset: 8px 8px auto auto;
|
||||
inline-size: 30px;
|
||||
box-shadow: 0 0 0 1px rgb(255 255 255 / 40%);
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.lf-pc__clip-toggle[aria-pressed="true"]::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
inset: -7px;
|
||||
}
|
||||
|
||||
.lf-pc__clip-toggle[aria-pressed="true"]:hover {
|
||||
background: var(--lf-navy-deep, var(--lf-navy));
|
||||
transform: none;
|
||||
}
|
||||
|
||||
.lf-pc__clip-toggle[aria-pressed="true"] .lf-pc__clip-icon {
|
||||
inline-size: 16px;
|
||||
block-size: 16px;
|
||||
}
|
||||
|
||||
.is-clip-playing > .lf-pc__badge {
|
||||
opacity: 0.85;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.lf-pc__clip { transition: none; }
|
||||
.lf-pc__clip-toggle { transition: none; }
|
||||
.lf-pc__clip-toggle:hover { transform: translate(-50%, -50%); }
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
<video class="lf-hero__video" muted loop playsinline preload="none" disablepictureinpicture disableremoteplayback tabindex="-1" aria-hidden="true"></video>
|
||||
<button type="button" class="lf-hero__video-toggle" aria-pressed="false" data-hero-toggle aria-label="Video abspielen: {{ $videoTitle }}" hidden>
|
||||
<svg class="lf-hero__video-icon" viewBox="0 0 24 24" focusable="false" aria-hidden="true"><path class="lf-hero__video-play" d="M8 5.5v13l11-6.5z" fill="currentColor"/><path class="lf-hero__video-pause" d="M7 5h4v14H7zM13 5h4v14h-4z" fill="currentColor"/></svg>
|
||||
<span aria-hidden="true">Video</span>
|
||||
<span class="lf-hero__video-label" aria-hidden="true">Video</span>
|
||||
</button>
|
||||
@endif
|
||||
<div class="lf-hero__inner">
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
Trailer der Premium-Karte (CardClip): stummer Clip über dem Kartenbild plus Schaltfläche. Das <video> bekommt seine
|
||||
Quelle erst beim ersten Start (resources/js/card-clip.js, preload="none"). Der Clip ist Beiwerk; Titel und Text der
|
||||
Karte stehen daneben, deshalb ist das Video für Hilfstechnik verborgen und die Schaltfläche trägt die Bedeutung. Die
|
||||
Schaltfläche ist bewusst nur ein kleines Symbol: Das Bild trägt schon die Art-Marke (Film), ein Text wäre doppelt.
|
||||
Schaltfläche ist bewusst nur ein Symbol ohne Text: Das Bild trägt schon die Art-Marke (Film). Solange der Clip nicht läuft,
|
||||
sitzt sie groß und halbtransparent mittig auf dem Bild, danach klein oben rechts (resources/css/components/lf-premium-card.css).
|
||||
--}}
|
||||
@if (($clipUrl ?? null) !== null)
|
||||
<video class="lf-pc__clip" muted loop playsinline preload="none" disablepictureinpicture disableremoteplayback tabindex="-1" aria-hidden="true"></video>
|
||||
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* Abspiel-Schaltfläche der Video-Bausteine (Einstieg und Premium-Karten): Solange der Clip nicht läuft, sitzt sie groß,
|
||||
* halbtransparent und mittig auf dem Vorschaubild; läuft er, wird sie klein und wandert in die Ecke. Die Gestaltung ist
|
||||
* CSS; geprüft wird hier, dass beide Bausteine sie gleich führen und die Bedienung (Schaltfläche, Beschriftung) bleibt.
|
||||
*/
|
||||
class VideoPlayButtonTest extends TestCase
|
||||
{
|
||||
private function css(string $file): string
|
||||
{
|
||||
return (string) file_get_contents(resource_path('css/components/'.$file));
|
||||
}
|
||||
|
||||
/** Regelblock zu einem Selektor, ohne Kommentare. */
|
||||
private function rule(string $css, string $selector): string
|
||||
{
|
||||
$css = (string) preg_replace('~/\*.*?\*/~s', '', $css);
|
||||
$this->assertSame(1, preg_match('~(?:^|\})\s*'.preg_quote($selector, '~').'\s*\{([^}]*)\}~', $css, $match), $selector.' fehlt.');
|
||||
|
||||
return $match[1];
|
||||
}
|
||||
|
||||
public function test_the_idle_button_is_centered_large_and_translucent_on_the_hero(): void
|
||||
{
|
||||
$rule = $this->rule($this->css('lf-hero.css'), '.lf-hero__video-toggle');
|
||||
|
||||
$this->assertStringContainsString('translate(-50%, -50%)', $rule);
|
||||
$this->assertStringContainsString('inset-block-start: 50%', $rule);
|
||||
$this->assertMatchesRegularExpression('/border-radius:\s*50%/', $rule);
|
||||
$this->assertMatchesRegularExpression('/inline-size:\s*clamp\(64px/', $rule, 'Mindestens 64 px, damit sie gut erkennbar ist.');
|
||||
$this->assertMatchesRegularExpression('/background:\s*rgb\(3 37 81 \/ \d+%\)/', $rule);
|
||||
$this->assertStringNotContainsString('86%', $rule, 'Halbtransparent, nicht deckend.');
|
||||
}
|
||||
|
||||
public function test_the_idle_button_is_centered_large_and_translucent_on_the_cards(): void
|
||||
{
|
||||
$rule = $this->rule($this->css('lf-premium-card.css'), '.lf-pc__clip-toggle');
|
||||
|
||||
$this->assertStringContainsString('translate(-50%, -50%)', $rule);
|
||||
$this->assertMatchesRegularExpression('/inset:\s*50% auto auto 50%/', $rule);
|
||||
$this->assertMatchesRegularExpression('/border-radius:\s*50%/', $rule);
|
||||
$this->assertMatchesRegularExpression('/inline-size:\s*clamp\(48px/', $rule);
|
||||
$this->assertMatchesRegularExpression('/background:\s*rgb\(3 37 81 \/ \d+%\)/', $rule);
|
||||
}
|
||||
|
||||
public function test_the_running_button_moves_to_the_corner_in_both_blocks(): void
|
||||
{
|
||||
$hero = $this->rule($this->css('lf-hero.css'), '.lf-hero__video-toggle[aria-pressed="true"]');
|
||||
$card = $this->rule($this->css('lf-premium-card.css'), '.lf-pc__clip-toggle[aria-pressed="true"]');
|
||||
|
||||
$this->assertStringContainsString('transform: none', $hero);
|
||||
$this->assertStringContainsString('inset-inline-end: 12px', $hero);
|
||||
$this->assertStringContainsString('min-block-size: 44px', $hero, 'Trefferfläche mindestens 44 px.');
|
||||
$this->assertStringContainsString('transform: none', $card);
|
||||
$this->assertStringContainsString('inset: 8px 8px auto auto', $card);
|
||||
}
|
||||
|
||||
public function test_the_narrow_hero_centers_the_button_on_the_image_above_the_text(): void
|
||||
{
|
||||
$css = $this->css('lf-hero.css');
|
||||
|
||||
$this->assertStringContainsString('.lf-hero__video-toggle:not([aria-pressed="true"]) { inset-block-start: calc(100cqi * 9 / 32); inset-inline-start: 50%;', $css);
|
||||
}
|
||||
|
||||
public function test_both_buttons_stay_real_buttons_with_a_label_and_a_visible_focus(): void
|
||||
{
|
||||
$hero = (string) file_get_contents(resource_path('views/widgets/hero.blade.php'));
|
||||
$clip = (string) file_get_contents(resource_path('views/widgets/partials/card-clip.blade.php'));
|
||||
|
||||
$this->assertStringContainsString('<button type="button" class="lf-hero__video-toggle" aria-pressed="false" data-hero-toggle aria-label="Video abspielen:', $hero);
|
||||
$this->assertStringContainsString('<button type="button" class="lf-pc__clip-toggle" aria-pressed="false" data-clip-toggle aria-label="Trailer abspielen:', $clip);
|
||||
$this->assertStringContainsString('.lf-hero__video-toggle:focus-visible', $this->css('lf-hero.css'));
|
||||
$this->assertStringContainsString('.lf-pc__clip-toggle:focus-visible', $this->css('lf-premium-card.css'));
|
||||
}
|
||||
|
||||
public function test_reduced_motion_removes_the_button_animation(): void
|
||||
{
|
||||
$this->assertMatchesRegularExpression('/prefers-reduced-motion[^{]*\{[^@]*\.lf-hero__video-toggle \{ transition: none; \}/s', $this->css('lf-hero.css'));
|
||||
$this->assertMatchesRegularExpression('/prefers-reduced-motion[^{]*\{[^@]*\.lf-pc__clip-toggle \{ transition: none; \}/s', $this->css('lf-premium-card.css'));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user