Files
fewo-stommer/resources/themes/seebad/views/sections/floor_plan.blade.php
T
LarsandClaude Opus 5.5 f7cbc66451
Deploy / test (push) Failing after 2s
Deploy / deploy (push) Skipped
Section "Grundriss (interaktiv)": floor plan with rooms, admin editor, Seebad view
- Table floor_plans (tenant_id, one per apartment, picture = website photo, rooms as JSON with
  corners in percent of the picture), model FloorPlan with BelongsToTenant, Property::floorPlan()
- Admin › Webseite › Grundriss: room list with name, description, photos, equipment (from the
  equipment list), accessibility hint, visibility, and an area editor (click the corners on the picture)
- Section floor_plan: base view without JavaScript (areas jump to the room list), Seebad view with
  room buttons, highlighted area and a cartouche per room (theme.js initFloorPlans)
- Tests: tenant inheritance, point parsing, website output, admin create incl. validation; the
  render test for all themes now includes the floor plan
- Docs: THEMES §5, ZUSAMMENARBEIT §6, STATUS §6 (incl. note for tenancy phase 5)
- styles/grundriss: revised rendering, WebP renditions, room areas of the Stommer flat in percent

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:26:02 +02:00

68 lines
5.0 KiB
PHP

{{--
Contract: $heading, $text, $photo, $rooms (see ostsee-licht/views/sections/floor_plan.blade.php).
theme.js (initFloorPlans) shows one room at a time; without JavaScript all rooms are listed and the areas jump to them.
--}}
@if ($photo && $rooms->isNotEmpty())
<section class="mx-auto max-w-7xl px-4 py-16 sm:px-8 sm:py-20" aria-labelledby="{{ $sectionId }}-title" data-floor-plan>
<div class="flex flex-wrap items-end justify-between gap-x-12 gap-y-3">
<h2 id="{{ $sectionId }}-title" class="heading-display">{{ $heading }}</h2>
@if ($text)<p class="max-w-[44ch] text-muted">{{ $text }}</p>@endif
</div>
<div class="mt-10 flex flex-wrap items-start gap-10">
<div class="min-w-0 flex-[999_1_38rem]">
<div class="border-2 border-ink bg-surface p-2 sm:p-4">
<div class="relative">
@include('theme::partials.image', ['photo' => $photo, 'sizes' => '(min-width: 1024px) 60vw, 100vw', 'class' => 'h-auto w-full'])
<svg viewBox="0 0 100 100" preserveAspectRatio="none" class="absolute inset-0 size-full" role="group" aria-label="Räume im Grundriss">
@foreach ($rooms as $room)
<a href="#{{ $room['key'] }}" data-floor-room-link="{{ $room['key'] }}" aria-label="{{ $room['name'] }}" class="group">
<polygon points="{{ $room['points'] }}" vector-effect="non-scaling-stroke"
class="fill-accent/0 stroke-accent/50 [stroke-width:2] transition group-hover:fill-accent/15 group-focus-visible:fill-accent/20 group-data-[active]:fill-accent/25 group-data-[active]:stroke-accent group-data-[active]:[stroke-width:3]"><title>{{ $room['name'] }}</title></polygon>
</a>
@endforeach
</svg>
</div>
</div>
<nav aria-label="Raum wählen" class="mt-5">
<ul class="flex flex-wrap gap-2.5">
@foreach ($rooms as $room)
<li><a href="#{{ $room['key'] }}" data-floor-room-link="{{ $room['key'] }}"
class="inline-flex min-h-12 items-center rounded-full border-2 border-ink bg-surface px-5 font-semibold hover:bg-ink/5 data-[active]:bg-ink data-[active]:text-ground">{{ $room['name'] }}</a></li>
@endforeach
</ul>
</nav>
</div>
<div class="min-w-0 flex-[1_1_22rem] space-y-12">
@foreach ($rooms as $room)
<article id="{{ $room['key'] }}" data-floor-room class="cartouche scroll-mt-28 px-6 pt-10 pb-7 sm:px-7" aria-labelledby="{{ $room['key'] }}-name">
<span class="absolute -top-0.5 -left-0.5" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
<span class="absolute -top-0.5 -right-0.5 -scale-x-100" aria-hidden="true">@include('theme::partials.motif', ['slot' => 'bracket', 'class' => 'size-9'])</span>
@if ($room['photos']->isNotEmpty())
@include('theme::partials.image', ['photo' => $room['photos']->first(), 'sizes' => '(min-width: 1024px) 26rem, 100vw', 'class' => 'mb-5 h-56 w-full rounded object-cover'])
@endif
<h3 id="{{ $room['key'] }}-name" class="font-display text-[2rem] leading-tight">{{ $room['name'] }}</h3>
@if ($room['description'])<p class="mt-2 text-muted">{{ $room['description'] }}</p>@endif
@if ($room['amenities']->isNotEmpty())
<ul class="mt-4 space-y-1.5">
@foreach ($room['amenities'] as $amenity)
<li class="flex gap-3"><x-heroicon-o-check class="mt-1 size-5 shrink-0 text-accent" aria-hidden="true" />{{ $amenity }}</li>
@endforeach
</ul>
@endif
@if ($room['hint'])<p class="mt-5 border-l-[3px] border-accent bg-ground px-4 py-3">{{ $room['hint'] }}</p>@endif
@if ($room['photos']->count() > 1)
<ul class="mt-5 grid grid-cols-3 gap-2">
@foreach ($room['photos']->skip(1) as $more)
<li><a href="{{ $more->url('lg') }}" data-lightbox data-alt="{{ $more->alt_text }}" class="block overflow-hidden rounded">@include('theme::partials.image', ['photo' => $more, 'sizes' => '8rem', 'class' => 'h-20 w-full object-cover'])</a></li>
@endforeach
</ul>
@endif
</article>
@endforeach
</div>
</div>
</section>
@endif