@extends('layouts.app') @section('title', 'Hasil Event - ' . $event->name) @section('page-style') @endsection @section('content')

Hasil / {{ $event->name }} {{ $event->status === 'active' ? 'Berlangsung' : ($event->status === 'closed' ? 'Selesai' : $event->status) }}

Ekspor CSV Kembali
Total DPT

{{ $totalVoters }}

Pemilih terdaftar
Total Suara Masuk

{{ $totalVotes }}

{{ $votersVoted }} pemilih ({{ $totalVoters > 0 ? round(($votersVoted / $totalVoters) * 100, 2) : 0 }}% Partisipasi)
Belum Memilih

{{ $votersNotVoted }} ({{ $totalVoters > 0 ? round(($votersNotVoted / $totalVoters) * 100, 2) : 0 }}%)

Belum menyalurkan suara
Terunggul Sementara
{{ $leadingCandidate ? $leadingCandidate->name : 'Belum Ada' }}
@if($leadingCandidate) {{ $leadingCandidate->votes_count }} Suara ({{ $leadingCandidate->percentage }}%) @else Menunggu suara masuk @endif
@if($event->max_choices > 1) @endif
Visualisasi Data Suara
@if(count($timelineData['labels']) > 0)
@else
Belum Ada Data Tren

Grafik tren akan muncul secara otomatis setelah suara masuk mulai terekam.

@endif
Hasil Perolehan Suara
@php $rank = 1; $maxVotes = $rankedCandidates->first()->votes_count ?? 1; if ($maxVotes <= 0) { $maxVotes = 1; } @endphp @forelse($rankedCandidates as $candidate) @php $ratio = $candidate->votes_count / $maxVotes; // Blended formula: 25% linear + 75% power-scaled (exponent 18) to stretch small vote gaps // dynamically, ensuring close candidates have highly visible bar length differences // while lower tier candidates still display proportional widths. $barWidth = (0.25 * $ratio + 0.75 * pow($ratio, 18)) * 100; $barColorClass = 'bg-rank-default'; if ($rank == 1) $barColorClass = 'bg-rank-1'; elseif ($rank == 2) $barColorClass = 'bg-rank-2'; elseif ($rank == 3) $barColorClass = 'bg-rank-3'; @endphp
@if($rank == 1) @elseif($rank == 2) 2 @elseif($rank == 3) 3 @else {{ $rank }} @endif
@if($candidate->photo_path) Candidate @else @endif
{{ $candidate->name }}
No. Urut {{ $candidate->sort_order }} | ID: {{ $candidate->id }}
{{ $candidate->votes_count }} {{ $candidate->percentage }}%
@php $rank++; @endphp @empty

Tidak ada kandidat terdaftar.

@endforelse
@endsection @push('scripts') @endpush