Design Stufe 2: Tipp-Karten zum Umdrehen, Sommer/Winter-Vergleich, Galerie mit weichem Vergroessern
Deploy FeWo mit PipelineManager / deploy (push) Successful in 3m45s

- Baustein "Ausflugstipps" (tips): Karten mit Foto vorne, Tipp/Weg/beste Zeit hinten; Seebad als Ansichtskarten
- Baustein "Sommer/Winter-Vergleich" (compare): Trennlinie ziehen, Tastatur ueber Range-Input, einmaliger Hinweis-Schwenk
- Lightbox: Foto waechst aus der Vorschau, Blaettern (Pfeile, Tasten, Wischen), Zaehler, Bildunterschrift; partials/lightbox
- Bewegung reduzieren: Ueberblenden statt Drehen, kein Schwenk, keine Zoom-Animation

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-10-30 21:05:16 +01:00
1 parent c8bb0f6e97
commit 4c9e6992f4
20 files changed
+785 -43

No files matched your search

+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Themes\Sections;
use App\Themes\Theme;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
/**
* The same view in two seasons (e.g. terrace in summer and winter): guests drag a dividing line across the photo.
* Both photos are shown in every appearance – the comparison is the point, so season limits do not apply here.
*/
class CompareSection extends Section
{
public static function key(): string
{
return 'compare';
}
public static function label(): string
{
return 'Sommer/Winter-Vergleich';
}
public static function icon(): string
{
return 'heroicon-o-arrows-right-left';
}
public static function schema(): array
{
return [
TextInput::make('eyebrow')->label('Kleine Überschrift')->maxLength(100),
TextInput::make('heading')->label('Überschrift')->default('Derselbe Blick, zwei Jahreszeiten')->maxLength(160),
Textarea::make('text')->label('Text')->rows(2)->maxLength(400),
static::photoSelect('first_photo_id', 'Erstes Foto (links)')
->helperText('Am besten vom selben Standpunkt aufgenommen wie das zweite Foto. Beide erscheinen in jedem Erscheinungsbild.')
->required(),
TextInput::make('first_label')->label('Bezeichnung erstes Foto')->default('Sommer')->required()->maxLength(30),
static::photoSelect('second_photo_id', 'Zweites Foto (rechts)')->required(),
TextInput::make('second_label')->label('Bezeichnung zweites Foto')->default('Winter')->required()->maxLength(30),
];
}
public function data(Theme $theme, array $data): array
{
$photos = $this->photos(array_values(array_filter([$data['first_photo_id'] ?? null, $data['second_photo_id'] ?? null])))->keyBy('id');
return [
'eyebrow' => $data['eyebrow'] ?? null,
'heading' => $data['heading'] ?? null,
'text' => $data['text'] ?? null,
'first' => $photos->get((int) ($data['first_photo_id'] ?? 0)),
'second' => $photos->get((int) ($data['second_photo_id'] ?? 0)),
'firstLabel' => filled($data['first_label'] ?? null) ? $data['first_label'] : 'Sommer',
'secondLabel' => filled($data['second_label'] ?? null) ? $data['second_label'] : 'Winter',
];
}
}