@extends('layouts.user') @section('title') Bidding Marketplace @endsection @section('content') @php // NEXUS Session State // When engine is inactive, all values stay false/null and the session hero is hidden. $nexusActive = \App\Nexus\Engine\NexusConfig::isNexusActive(); $sessionOpen = false; $sessionEndTime = null; $nextSessionTime = null; $activeSessionNumber = null; $nextSessionNumber = null; $activeSessionName = null; $nextSessionName = null; $sessionNames = [1 => 'Dawn', 2 => 'Midday', 3 => 'Dusk']; $sessionTimes = [ 1 => (int) \App\Nexus\Engine\NexusConfig::get('session_1_start_utc'), 2 => (int) \App\Nexus\Engine\NexusConfig::get('session_2_start_utc'), 3 => (int) \App\Nexus\Engine\NexusConfig::get('session_3_start_utc'), ]; if ($nexusActive) { $sc = new \App\Nexus\Engine\SessionController(); $activeSession = $sc->getActiveSession(); $sessionOpen = ($activeSession !== null); if ($sessionOpen) { $activeSessionNumber = $activeSession->session_number; $activeSessionName = $sessionNames[$activeSessionNumber] ?? 'Session ' . $activeSessionNumber; $durationMinutes = \App\Nexus\Engine\NexusConfig::getInt('session_duration_minutes', 60); $sessionEndTime = \Carbon\Carbon::parse($activeSession->actual_start) ->addMinutes($durationMinutes) ->toIso8601String(); } else { $nextSessionTime = $sc->getNextSessionTime()->toIso8601String(); // Determine which session is next based on current UTC hour $currentUtcHour = now()->utc()->hour; foreach ($sessionTimes as $num => $hour) { if ($hour > $currentUtcHour) { $nextSessionNumber = $num; break; } } if (!$nextSessionNumber) $nextSessionNumber = 1; // wrap to tomorrow $nextSessionName = $sessionNames[$nextSessionNumber] ?? 'Session ' . $nextSessionNumber; } } // Brand-color mapping for market logo backgrounds // Keyed by lowercase market name. Dark backgrounds for logos with white text. $brandColors = [ 'slick deals' => 'linear-gradient(150deg,#e8f4fd 0%,#dbeafe 100%)', 'brickseek' => 'linear-gradient(150deg,#dbeafe 0%,#e0e7ff 100%)', 'alibaba' => 'linear-gradient(150deg,#fff7ed 0%,#ffedd5 100%)', 'hotukdeals' => 'linear-gradient(150deg,#fef9c3 0%,#fef3c7 100%)', 'latestdeals' => 'linear-gradient(150deg,#1e293b 0%,#0f172a 100%)', 'target' => 'linear-gradient(150deg,#fef2f2 0%,#fee2e2 100%)', 'aliexpress' => 'linear-gradient(150deg,#fef2f2 0%,#ffe4e6 100%)', 'bestbuy' => 'linear-gradient(150deg,#172554 0%,#1e3a5f 100%)', 'rakuten' => 'linear-gradient(150deg,#fef2f2 0%,#fce7f3 100%)', 'mercado libre' => 'linear-gradient(150deg,#fef9c3 0%,#fef3c7 100%)', 'newegg' => 'linear-gradient(150deg,#f5f5f4 0%,#e7e5e4 100%)', 'etsy' => 'linear-gradient(150deg,#fff7ed 0%,#ffedd5 100%)', 'bonanza' => 'linear-gradient(150deg,#ecfdf5 0%,#d1fae5 100%)', 'amazon' => 'linear-gradient(150deg,#fff7ed 0%,#ffedd5 100%)', 'ebay' => 'linear-gradient(150deg,#f5f5f4 0%,#e7e5e4 100%)', 'shopify' => 'linear-gradient(150deg,#ecfdf5 0%,#d1fae5 100%)', 'temu' => 'linear-gradient(150deg,#fff7ed 0%,#ffedd5 100%)', 'walmart' => 'linear-gradient(150deg,#dbeafe 0%,#eff6ff 100%)', 'affiliate vendor' => 'linear-gradient(150deg,#f5f5f4 0%,#e7e5e4 100%)', ]; $defaultBg = 'linear-gradient(150deg,#f5f5f4 0%,#e7e5e4 100%)'; // Market categories for display under name $marketCategories = [ 'slick deals' => 'Deals', 'brickseek' => 'Retail', 'alibaba' => 'Wholesale', 'hotukdeals' => 'UK Deals', 'latestdeals' => 'Bargains', 'target' => 'Retail', 'aliexpress' => 'Global', 'bestbuy' => 'Electronics', 'rakuten' => 'Cashback', 'mercado libre' => 'LATAM', 'newegg' => 'Tech', 'etsy' => 'Handmade', 'bonanza' => 'Marketplace', 'amazon' => 'Global', 'ebay' => 'Auction', 'shopify' => 'Direct', 'temu' => 'Value', 'walmart' => 'Retail', 'affiliate vendor' => 'Affiliate', ]; @endphp
{{-- Session hero (hidden when NEXUS is inactive) --}} @if($nexusActive)
@if($sessionOpen)
Trading Session Open
{{ $activeSessionName }} / Session {{ $activeSessionNumber }}
Place your bids now. Session closes automatically.
@else
Next Session
{{ $nextSessionName }} / Session {{ $nextSessionNumber }}
Browse markets and get your bids ready.
@endif
--:--
{{ $sessionOpen ? 'remaining' : 'until open' }}
@foreach($sessionTimes as $num => $hour) @php $isActive = $sessionOpen && $activeSessionNumber === $num; $isNext = !$sessionOpen && $nextSessionNumber === $num; $pillClass = $isActive ? 'pill-active' : ($isNext ? 'pill-next' : ''); @endphp @if($num > 1)@endif
Session {{ $num }}
@endforeach
{{-- Edu hint --}}

3 daily trading sessions. Place bids during an open session. Each runs for 1 hour. Browse markets anytime, bid when a session is live.

@else {{-- When NEXUS is inactive: simple header, no session awareness --}}

Bidding Marketplace

Select A Market To Bid From

Home Bid Marketplace
@endif {{-- Marketplace title --}} @if($nexusActive)
Bidding Marketplace
Select a market to browse products and place your bids
@endif {{-- Search --}}
Markets
{{-- Market grid --}}
@foreach($markets as $market) @php $nameKey = strtolower(trim($market->name)); $bg = $brandColors[$nameKey] ?? $defaultBg; $category = $marketCategories[$nameKey] ?? ''; @endphp
{{ $market->name }}
@if($category)
{{ $category }}
@endif
@endforeach

No markets match your search.

@endsection