@props([ // Up to 5 stops along the arc: [label, state] where state is done | now | next 'items' => [ ['Company onboarding', 'done'], ['Workplace safety', 'done'], ['Data privacy', 'done'], ['Leading a team', 'now'], ['Project finance', 'next'], ], ]) @php // Evenly spaced points on the arc (0, 25, 50, 75, 100% of its length) $slots = [[40, 380], [143, 301], [241, 210], [349, 128], [450, 40]]; $items = array_slice(array_values($items), 0, 5); $n = count($items); // Spread fewer than 5 stops across the whole arc $at = fn ($i) => $n > 1 ? (int) round($i * 4 / ($n - 1)) : 0; $reached = collect($items)->keys()->filter(fn ($i) => $items[$i][1] !== 'next')->last(); $drawn = $reached === null ? 0 : $at($reached) / 4; $done = collect($items)->where(1, 'done')->count(); $now = collect($items)->where(1, 'now')->count(); @endphp {{-- Signature: a learner's path drawn as a meridian arc (dark backgrounds only) --}}
merge(['class' => 'relative']) }}>
Learning path: {{ $done }} completed, {{ $now }} in progress, {{ count($items) - $done - $now }} up next.