@extends('layouts.app')
@section('title','My Badges')
@push('styles')
@endpush
@section('content')
@php
$earned = collect($earnedKeys);
$earnedCount = count($earnedKeys);
$totalCount = count($allBadges);
@endphp
@if($earnedCount > 0)
@php
$howToEarn = [
'first_recycle' => 'Schedule and complete your first pickup',
'recycle_10' => 'Complete 10 confirmed recyclings',
'recycle_50' => 'Complete 50 confirmed recyclings',
'recycle_100' => 'Complete 100 confirmed recyclings',
'kg_10' => 'Recycle a total of 10kg of waste',
'kg_100' => 'Recycle a total of 100kg of waste',
'first_earn' => 'Earn your first Nabola Coins',
'coins_100' => 'Earn 100 NC total',
'coins_1000' => 'Earn 1,000 NC total',
'coins_10000' => 'Earn 10,000 NC total',
'streak_3' => 'Check in 3 days in a row',
'streak_7' => 'Check in 7 days in a row',
'streak_30' => 'Check in every day for 30 days',
'first_referral' => 'Refer your first friend using your code',
'referral_5' => 'Refer 5 friends to Nabola',
'first_machine' => 'Use a Nabola recycling machine',
'first_donation' => 'Donate coins to any campaign',
'first_purchase' => 'Buy something from the marketplace',
];
$rarity = [
'first_recycle'=>'Common','recycle_10'=>'Common','recycle_50'=>'Rare','recycle_100'=>'Legendary',
'kg_10'=>'Common','kg_100'=>'Rare','first_earn'=>'Common','coins_100'=>'Common',
'coins_1000'=>'Rare','coins_10000'=>'Legendary','streak_3'=>'Common','streak_7'=>'Rare',
'streak_30'=>'Legendary','first_referral'=>'Common','referral_5'=>'Rare',
'first_machine'=>'Common','first_donation'=>'Common','first_purchase'=>'Common',
];
$rarityColors = ['Common'=>'#9ca3af','Rare'=>'#60a5fa','Legendary'=>'#fbbf24'];
@endphp
@foreach($allBadges as $key => $badge)
@if(!isset($earnedKeys[$key]))
@if(isset($rarity[$key]))
{{ $rarity[$key] }}
@endif
{{ $badge['emoji'] }}
{{ $badge['name'] }}
{{ $badge['desc'] }}
@if(isset($howToEarn[$key]))
{{ $howToEarn[$key] }}
@endif
@endif
@endforeach
@endsection
@push('scripts')
@endpush