adasd
All checks were successful
Deploy / deploy (push) Successful in 1m1s

This commit is contained in:
2026-07-29 21:27:36 +02:00
parent ae34348b29
commit f0ff95679b
6 changed files with 82 additions and 68 deletions

View File

@@ -359,6 +359,61 @@ $sectionLinks = [
<strong><?= htmlspecialchars((string)($component['label'] ?? $field), ENT_QUOTES) ?></strong>
<span class="muted small">Gesamtes Profilbild zur sicheren Vorschau</span>
</div>
<?php $componentColors = $component['colors'] ?? []; ?>
<?php if ($componentColors): ?>
<div class="avatar-component-colors">
<?php foreach ($componentColors as $colorField => $colorMeta): ?>
<?php
$colorValue = (string)($colorMeta['value'] ?? '');
$colorDefault = '#000000';
$samples = is_array($colorMeta['samples'] ?? null) ? $colorMeta['samples'] : [];
?>
<div class="avatar-color-control">
<label class="avatar-color-control__label" for="avatarColor<?= htmlspecialchars($styleKey . $colorField, ENT_QUOTES) ?>"><?= htmlspecialchars((string)($colorMeta['label'] ?? $colorField), ENT_QUOTES) ?></label>
<input
type="hidden"
name="avatar_config[<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>][<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>]"
value="<?= htmlspecialchars($colorValue, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-input="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
>
<div class="avatar-color-control__row">
<input
id="avatarColor<?= htmlspecialchars($styleKey . $colorField, ENT_QUOTES) ?>"
type="color"
value="<?= htmlspecialchars($colorValue !== '' ? $colorValue : $colorDefault, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-picker="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
data-avatar-color-default="<?= htmlspecialchars($colorDefault, ENT_QUOTES) ?>"
class="avatar-color-control__picker"
>
<button
class="btn ghost avatar-color-control__reset"
type="button"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-reset="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
>Standard</button>
</div>
<?php if ($samples): ?>
<div class="avatar-color-control__samples">
<?php foreach ($samples as $sampleColor): ?>
<button
type="button"
class="avatar-color-sample"
title="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
aria-label="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-sample-field="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
data-avatar-color-sample-value="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
style="background: <?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>;"
></button>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
<div class="avatar-component-grid">
<?php foreach (($component['options'] ?? []) as $choice): ?>
<label class="avatar-component-card">
@@ -384,61 +439,6 @@ $sectionLinks = [
</label>
<?php endforeach; ?>
</div>
<?php $componentColors = $component['colors'] ?? []; ?>
<?php if ($componentColors): ?>
<div class="form-grid" style="margin-top:18px;">
<?php foreach ($componentColors as $colorField => $colorMeta): ?>
<?php
$colorValue = (string)($colorMeta['value'] ?? '');
$colorDefault = (string)($colorMeta['default'] ?? '#c4a484');
$samples = is_array($colorMeta['samples'] ?? null) ? $colorMeta['samples'] : [];
?>
<div class="stack gap-6">
<label class="label" for="avatarColor<?= htmlspecialchars($styleKey . $colorField, ENT_QUOTES) ?>"><?= htmlspecialchars((string)($colorMeta['label'] ?? $colorField), ENT_QUOTES) ?></label>
<input
type="hidden"
name="avatar_config[<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>][<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>]"
value="<?= htmlspecialchars($colorValue, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-input="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
>
<div class="flex gap-12 center-y" style="flex-wrap:wrap;">
<input
id="avatarColor<?= htmlspecialchars($styleKey . $colorField, ENT_QUOTES) ?>"
type="color"
value="<?= htmlspecialchars($colorValue !== '' ? $colorValue : $colorDefault, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-picker="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
data-avatar-color-default="<?= htmlspecialchars($colorDefault, ENT_QUOTES) ?>"
style="width:64px; height:44px; padding:4px;"
>
<button
class="btn ghost"
type="button"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-reset="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
>Standard</button>
</div>
<?php if ($samples): ?>
<div class="flex gap-8 center-y" style="flex-wrap:wrap;">
<?php foreach ($samples as $sampleColor): ?>
<button
type="button"
class="avatar-color-sample"
title="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
aria-label="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
data-avatar-style="<?= htmlspecialchars($styleKey, ENT_QUOTES) ?>"
data-avatar-color-sample-field="<?= htmlspecialchars((string)$colorField, ENT_QUOTES) ?>"
data-avatar-color-sample-value="<?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>"
style="width:32px; height:32px; border-radius:10px; border:1px solid var(--color-border); background: <?= htmlspecialchars((string)$sampleColor, ENT_QUOTES) ?>;"
></button>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
</section>
<?php endforeach; ?>
</div>