feat: improve company history timeline display by dynamically assigning positions based on index, enhancing visual consistency and user experience

This commit is contained in:
Ümit Tunç
2026-05-21 20:22:34 +03:00
parent 506a98163a
commit d24c9e4502
@@ -40,10 +40,12 @@
</div>
<div class="company-history-timeline__track" style="--timeline-gradient: linear-gradient(to bottom, {{ $gradientStops }});">
@foreach($historyItems as $item)
@foreach($historyItems as $index => $item)
@php
$color = $item->color ?? '#17a2b8';
$position = $item->resolved_position;
$position = in_array($item->position, ['left', 'right'], true)
? $item->position
: ($index % 2 === 0 ? 'right' : 'left');
$title = method_exists($item, 'translate') ? ($item->translate('title') ?: $item->title) : $item->title;
$titleUpper = $title ? locale_upper($title) : null;
$content = method_exists($item, 'translate') ? ($item->translate('content') ?: $item->content) : $item->content;