Beiträge mit dem Baukasten der Seiten, Galerie-Großansicht mit Blättern
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m42s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m3s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m32s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 5m41s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 6m5s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 4m57s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 4m59s
CI / Build-Artefakte aktuell (pull_request) Failing after 1m35s

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-26 19:43:05 +00:00
parent 3b72b5327e
commit bdd21a38cb
164 changed files with 1276 additions and 623 deletions

View file

@ -1,10 +1,13 @@
<script setup>
import { inject } from 'vue';
import { ArrowUpRight } from '@lucide/vue';
import { Button } from '@/components/ui/button';
defineProps({ block: { type: Object, required: true } });
const variants = { primary: 'default', outline: 'outline', link: 'link' };
const editing = inject('pagebuilder:editing', false);
</script>
<template>
@ -15,6 +18,6 @@ const variants = { primary: 'default', outline: 'outline', link: 'link' };
<ArrowUpRight v-if="button.new_tab" />
</a>
</Button>
<p v-if="!block.data.buttons.length" class="text-sm text-muted-foreground">Noch keine Schaltflächen.</p>
<p v-if="editing && !block.data.buttons.length" class="text-sm text-muted-foreground">Noch keine Schaltflächen.</p>
</div>
</template>

View file

@ -1,9 +1,12 @@
<script setup>
import { inject } from 'vue';
import { Link } from '@inertiajs/vue3';
import { Mail, Phone } from '@lucide/vue';
import PersonAvatar from '@/components/PersonAvatar.vue';
defineProps({ block: { type: Object, required: true } });
const editing = inject('pagebuilder:editing', false);
</script>
<template>
@ -26,7 +29,7 @@ defineProps({ block: { type: Object, required: true } });
</div>
</div>
</div>
<p v-if="!(block.props?.people ?? []).length" class="text-sm text-muted-foreground">Noch keine Personen ausgewählt.</p>
<p v-if="editing && !(block.props?.people ?? []).length" class="text-sm text-muted-foreground">Noch keine Personen ausgewählt.</p>
</div>
</section>
</template>

View file

@ -1,32 +1,80 @@
<script setup>
import { computed, ref } from 'vue';
import { ImageIcon } from '@lucide/vue';
import { computed, inject, ref } from 'vue';
import { ChevronLeft, ChevronRight, ImageIcon } from '@lucide/vue';
import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog';
const props = defineProps({ block: { type: Object, required: true } });
const editing = inject('pagebuilder:editing', false);
const columns = { 2: '@xl:grid-cols-2', 3: '@xl:grid-cols-2 @3xl:grid-cols-3', 4: '@xl:grid-cols-3 @3xl:grid-cols-4' };
const images = computed(() => props.block.data.images.map((image, index) => ({ ...image, url: props.block.props?.urls?.[index] ?? null })));
const open = ref(null);
const viewable = computed(() => images.value.filter((image) => image.url));
// Großansicht mit Blättern (Pfeiltasten, Wischen, Knöpfe)
const openIndex = ref(null);
const current = computed(() => (openIndex.value === null ? null : viewable.value[openIndex.value]));
function show(image) {
openIndex.value = viewable.value.indexOf(image);
}
function step(direction) {
if (openIndex.value === null || viewable.value.length < 2) return;
openIndex.value = (openIndex.value + direction + viewable.value.length) % viewable.value.length;
}
function onKey(event) {
if (event.key === 'ArrowRight') step(1);
if (event.key === 'ArrowLeft') step(-1);
}
let touchX = null;
const touchStart = (event) => (touchX = event.touches[0].clientX);
function touchEnd(event) {
if (touchX === null) return;
const delta = event.changedTouches[0].clientX - touchX;
if (Math.abs(delta) > 50) step(delta < 0 ? 1 : -1);
touchX = null;
}
</script>
<template>
<div class="grid grid-cols-2 gap-3" :class="columns[block.data.columns]">
<figure v-for="(image, index) in images" :key="index">
<button v-if="image.url" type="button" class="block w-full overflow-hidden rounded-lg focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none" @click="open = image">
<img :src="image.url" :alt="image.alt" loading="lazy" class="aspect-[4/3] w-full object-cover transition-transform hover:scale-[1.02]" />
<button
v-if="image.url"
type="button"
class="block w-full cursor-zoom-in overflow-hidden rounded-lg focus-visible:ring-3 focus-visible:ring-ring/40 focus-visible:outline-none"
:aria-label="`${image.alt || 'Bild'} vergrößern`"
@click="show(image)"
>
<img :src="image.url" :alt="image.alt" loading="lazy" class="aspect-[4/3] w-full object-cover transition-transform duration-300 hover:scale-[1.03]" />
</button>
<div v-else class="grid aspect-[4/3] place-items-center rounded-lg border border-dashed bg-muted text-muted-foreground"><ImageIcon class="size-6" /></div>
<figcaption v-if="image.caption" class="mt-1.5 text-xs text-muted-foreground">{{ image.caption }}</figcaption>
</figure>
<p v-if="!images.length" class="col-span-full text-sm text-muted-foreground">Noch keine Bilder.</p>
<p v-if="editing && !images.length" class="col-span-full text-sm text-muted-foreground">Noch keine Bilder.</p>
</div>
<Dialog :open="!!open" @update:open="(value) => !value && (open = null)">
<DialogContent class="max-w-5xl p-2 sm:max-w-5xl">
<DialogTitle class="sr-only">{{ open?.alt || 'Bild' }}</DialogTitle>
<img v-if="open" :src="open.url" :alt="open.alt" class="max-h-[80vh] w-full rounded-md object-contain" />
<p v-if="open?.caption" class="px-2 pb-1 text-sm text-muted-foreground">{{ open.caption }}</p>
<Dialog :open="current !== null" @update:open="(value) => !value && (openIndex = null)">
<DialogContent class="max-w-6xl border-0 bg-black/95 p-0 text-white sm:max-w-6xl" @keydown="onKey">
<DialogTitle class="sr-only">{{ current?.alt || 'Bild' }}</DialogTitle>
<div class="relative" @touchstart.passive="touchStart" @touchend="touchEnd">
<img v-if="current" :key="current.url" :src="current.url" :alt="current.alt" class="max-h-[82vh] w-full object-contain" />
<template v-if="viewable.length > 1">
<button type="button" class="absolute top-1/2 left-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75" aria-label="Vorheriges Bild" @click="step(-1)">
<ChevronLeft class="size-6" />
</button>
<button type="button" class="absolute top-1/2 right-3 grid size-11 -translate-y-1/2 place-items-center rounded-full bg-black/50 text-white hover:bg-black/75" aria-label="Nächstes Bild" @click="step(1)">
<ChevronRight class="size-6" />
</button>
</template>
</div>
<div class="flex items-center justify-between gap-4 px-4 pt-1 pb-3 text-sm">
<p class="text-white/80">{{ current?.caption }}</p>
<span v-if="viewable.length > 1" class="shrink-0 text-white/60 tabular-nums">{{ openIndex + 1 }} / {{ viewable.length }}</span>
</div>
</DialogContent>
</Dialog>
</template>