feat: improve company history timeline display by dynamically assigning positions based on index, enhancing visual consistency and user experience
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user