@php $hour = now()->format('H'); if ($hour < 12) { $greeting = 'Good morning'; } elseif ($hour < 17) { $greeting = 'Good afternoon'; } else { $greeting = 'Good evening'; } @endphp
{{ $greeting }} ๐Ÿ‘‹

{{ Auth::user()->name }}

{{ Auth::user()->school_name ?? 'No School Provided' }}

๐Ÿ†
Cups Earned
{{ Auth::user()->cups }}
@if($announcement)
๐Ÿ“ข
Message of the Day

{{ $announcement }}

@endif
Trophy

๐Ÿ† Trophy Cabinet

@if(count($allTrophies) > 0) @php $initialActiveIndex = 0; foreach($allTrophies as $index => $trophy) { $hasEarned = Auth::user()->cups >= $trophy->min_cups; if ($hasEarned) { $initialActiveIndex = $index; } } @endphp
@foreach($allTrophies as $index => $trophy) @php $hasEarned = Auth::user()->cups >= $trophy->min_cups; $isCurrent = $hasEarned && (is_null($trophy->max_cups) || Auth::user()->cups <= $trophy->max_cups); @endphp
@if($trophy->image_path) @else
๐Ÿ†
@endif @if(!$hasEarned)
๐Ÿ”’
@endif

{{ $trophy->name }}

@if($isCurrent)

Current Tier

@else

{{ $trophy->min_cups }} Cups

@endif @if($hasEarned)
Earned โœ“
@endif
@endforeach
@php $nextTrophy = null; $prevTrophyCups = 0; foreach($allTrophies as $index => $t) { if (Auth::user()->cups < $t->min_cups) { $nextTrophy = $t; if ($index > 0) { $prevTrophyCups = $allTrophies[$index - 1]->min_cups; } break; } } if ($nextTrophy) { $targetCups = $nextTrophy->min_cups; $currentCups = Auth::user()->cups; $totalSegment = $targetCups - $prevTrophyCups; $currentSegment = max(0, $currentCups - $prevTrophyCups); $percent = $totalSegment > 0 ? min(100, round(($currentSegment / $totalSegment) * 100)) : 0; } else { $percent = 100; $targetCups = Auth::user()->cups; $currentCups = Auth::user()->cups; } @endphp
๐ŸŽฏ
Next Milestone
@if($nextTrophy) {{ $nextTrophy->name }} @else Ultimate Mode Active @endif
{{ $currentCups }} / {{ $targetCups }} Cups
@if($nextTrophy)
๐Ÿš€

Earn {{ $targetCups - $currentCups }} more cups to unlock!

@else
๐ŸŽ‰

All Trophies Unlocked!

@endif
@else
No trophies available yet
@endif

๐Ÿ“š Practice Quizzes

@php $userId = Auth::id(); $completedQuizIds = \App\Models\QuizAttempt::where('user_id', $userId) ->whereNotNull('completed_at') ->pluck('quiz_id') ->toArray(); $allPendingQuizzes = \App\Models\Quiz::whereNotIn('quizzes.id', $completedQuizIds) ->select('quizzes.*', 'sub_lessons.lesson_id', 'sub_lessons.order as sub_lesson_order', 'sub_lessons.title as sub_lesson_title', 'lessons.title as lesson_title', 'lessons.icon_path as lesson_icon_path') ->join('sub_lessons', 'quizzes.sub_lesson_id', '=', 'sub_lessons.id') ->join('lessons', 'sub_lessons.lesson_id', '=', 'lessons.id') ->withCount('questions') ->orderBy('lessons.id', 'asc') ->orderBy('sub_lessons.order', 'asc') ->orderBy('quizzes.id', 'asc') ->get(); $nextQuizzes = collect(); $seenLessons = []; foreach ($allPendingQuizzes as $quiz) { if (!in_array($quiz->lesson_id, $seenLessons)) { $seenLessons[] = $quiz->lesson_id; $nextQuizzes->push($quiz); if ($nextQuizzes->count() >= 4) { break; } } } $styles = [ [ 'icon' => '๐Ÿ”ฌ', 'bg' => 'bg-green-100/80', 'border' => 'border-green-200/50', 'text' => 'text-green-600', 'badge' => 'bg-green-500/90', 'glow' => 'bg-green-200/30', 'hover_text' => 'group-hover:text-green-700' ], [ 'icon' => '๐Ÿงฌ', 'bg' => 'bg-blue-100/80', 'border' => 'border-blue-200/50', 'text' => 'text-blue-600', 'badge' => 'bg-blue-500/90', 'glow' => 'bg-blue-200/30', 'hover_text' => 'group-hover:text-blue-700' ], [ 'icon' => '๐Ÿ”ญ', 'bg' => 'bg-purple-100/80', 'border' => 'border-purple-200/50', 'text' => 'text-purple-600', 'badge' => 'bg-purple-500/90', 'glow' => 'bg-purple-200/30', 'hover_text' => 'group-hover:text-purple-700' ], [ 'icon' => '๐Ÿงช', 'bg' => 'bg-rose-100/80', 'border' => 'border-rose-200/50', 'text' => 'text-rose-600', 'badge' => 'bg-rose-500/90', 'glow' => 'bg-rose-200/30', 'hover_text' => 'group-hover:text-rose-700' ], ]; @endphp
@forelse($nextQuizzes as $index => $quiz) @php $style = $styles[$index % count($styles)]; @endphp
@if($quiz->lesson_icon_path) Icon @else ๐ŸŒฟ @endif
{{ $quiz->lesson_title }}

{{ $quiz->sub_lesson_title }}

๐Ÿ“‹ {{ $quiz->questions_count }} Questions

@empty
๐ŸŽ‰

You're All Caught Up!

You've completed all available practice quizzes.

@endforelse

๐Ÿ… Leaderboard

Top 20 โ€ข This Week
@foreach($topStudents as $index => $student) @php $isMe = $student->id === Auth::id(); $rankBg = 'hover:bg-gray-50'; if ($isMe) { $rankBg = 'bg-gradient-to-r from-amber-100/80 to-yellow-50 border border-amber-300/50 shadow-[0_0_15px_rgba(245,158,11,0.15)] transform scale-[1.02] z-10 relative'; } elseif ($index === 0) { $rankBg = 'bg-gradient-to-r from-yellow-50/80 to-white border border-yellow-200/60 hover:shadow-sm hover:-translate-y-0.5'; } elseif ($index === 1) { $rankBg = 'bg-gradient-to-r from-gray-50 to-white border border-gray-200/60 hover:shadow-sm hover:-translate-y-0.5'; } elseif ($index === 2) { $rankBg = 'bg-gradient-to-r from-orange-50/50 to-white border border-orange-200/60 hover:shadow-sm hover:-translate-y-0.5'; } @endphp
@php $rankColor = 'text-gray-400'; if ($index === 0) $rankColor = 'text-yellow-500 drop-shadow-sm'; elseif ($index === 1) $rankColor = 'text-gray-400 drop-shadow-sm'; elseif ($index === 2) $rankColor = 'text-orange-400 drop-shadow-sm'; @endphp #{{ $index + 1 }}
{{ strtoupper(substr($student->name, 0, 2)) }}
@if($student->id === Auth::id())
YOU
@endif
{{ $student->name }}
{{ $student->school_name ?? 'No School' }}
{{ $student->cups }}
Cups
@endforeach @if(!$isInTop20)
#{{ $myRank }}
{{ strtoupper(substr(Auth::user()->name, 0, 2)) }}
YOU
{{ Auth::user()->name }}
{{ Auth::user()->school_name ?? 'No School' }}
{{ Auth::user()->cups }}
Cups
@endif