{{ __('Admin') }} {{ __('Settings') }} {{ __('Frontend theme') }}
@php $brandName = (string) brand_name(); // Resolve each theme's preview roles (bg/text/accent/...) to hex: Default // ships literal colours; the others point at palette tokens. $resolve = function (string $id, $role) use ($palettes) { if (is_array($role)) return array_map(fn ($r) => $palettes[$id]['values'][$r] ?? $r, $role); return $palettes[$id]['values'][$role] ?? $role; }; $mocks = []; foreach ($themes as $id => $t) { $m = $t['mock']; $mocks[$id] = [ 'bg' => $resolve($id, $m['bg']), 'text' => $resolve($id, $m['text']), 'accent' => $resolve($id, $m['accent']), 'onaccent' => $resolve($id, $m['onaccent']), 'cards' => $resolve($id, $m['cards']), 'swatches' => $resolve($id, $m['swatches']), ]; } $pvVars = function (array $mk) { return "--pv-bg:{$mk['bg']};--pv-text:{$mk['text']};--pv-accent:{$mk['accent']};--pv-onaccent:{$mk['onaccent']};" . "--pv-c1:{$mk['cards'][0]};--pv-c2:{$mk['cards'][1]};--pv-c3:{$mk['cards'][2]};" . "--pv-s1:{$mk['swatches'][0]};--pv-s2:{$mk['swatches'][1]};--pv-s3:{$mk['swatches'][2]};--pv-s4:{$mk['swatches'][3]}"; }; $roleMap = []; foreach ($themes as $id => $t) $roleMap[$id] = $t['mock']; @endphp {{-- One reset form per recolourable theme; forms can't nest inside the main form. --}} @foreach (array_keys($palettes) as $pid) @endforeach
@csrf
{{ __('Admin · Frontend theme') }}

{{ __('Website') }} {{ __('theme') }}.

{{ __('Pick the design of your public website — homepage, features, pricing, about, contact, blog — then recolour it to match your brand. Saving makes the selected theme live with these colours.') }}

{{ __('All settings') }} {{ __('Open the site') }} @if (session('status')) {{ session('status') }} @endif
{{-- Theme picker --}}
{{ __('Step 1') }}

{{ __('Choose a theme') }}

{{ __('Live now:') }} {{ __($themes[$active]['name'] ?? 'Default') }}
@foreach ($themes as $id => $t) @php $isSel = $editing === $id; $isLive = $active === $id; @endphp @endforeach
{{-- LEFT — colours of the selected theme --}}
{{-- Default theme — coloured in the Frontend editor --}}
{{ __('Step 2') }}

{{ __('Default theme colours') }}

{{ __('The Default theme is recoloured in the Frontend editor, where you can also edit its text and sections with a live preview.') }}

{{ __('Open the Frontend editor') }} →
@foreach ($palettes as $pid => $pal) @php $groups = collect($pal['tokens'])->groupBy(fn ($m) => $m[2], true); @endphp
@foreach ($groups as $groupName => $tokens)
{{ __('Step 2') }} · {{ __($themes[$pid]['name']) }}

{{ __($groupName) }}

{{ count($tokens) }} {{ __('colours') }}
@foreach ($tokens as $key => $m) @php $hex = $pal['values'][$key]; $isDefault = strtoupper($hex) === strtoupper($m[1]); @endphp @endforeach
@endforeach
@endforeach
{{-- RIGHT — live preview, guide, reset --}}
{{ __('Saving makes the selected theme live with these colours.') }}
{{ __('Cancel') }}
{{-- Per-theme preview texts for the JS (name / eyebrow / headline). --}} @php $ftMeta = []; foreach ($themes as $id => $t) { $ftMeta[$id] = ['name' => __($t['name']), 'eyebrow' => $t['eyebrow'], 'headline' => $t['headline'], 'mock' => $mocks[$id]]; } @endphp