@extends('layouts.gamification')
@section('title', __('Достижения'))
@section('gami-active', 'achievements')
@push('styles')
@endpush
@section('gami-content')
{{ __('🏆 Достижения') }}
{{ __('Очки достижений:') }} {{ (int) $achievementScore }}
· {{ __('рейтинг по достижениям') }}
{{ __('Закрепите до :n полученных достижений — их значки будут видны рядом с вашим именем в рейтинге. Если ничего не закреплено, показываются лучшие.', ['n' => \App\Services\ActivityAchievements::MAX_BADGES]) }}
@php
$sections = \App\Support\AchievementCategories::group($achievements);
@endphp
@if (count($sections) > 1)
@foreach ($sections as $s)
{{ $s['icon'] }} {{ __($s['label']) }} {{ $s['done'] }}/{{ $s['total'] }}
@endforeach
@endif
@foreach ($sections as $s)
{{ $s['icon'] }} {{ __($s['label']) }}
{{ $s['done'] }} / {{ $s['total'] }}
@foreach ($s['items'] as $a)
@php
$isUnlocked = $a->completed_at !== null;
$isClaimed = $a->claimed_at !== null;
$progress = (int) ($a->progress ?? 0);
$target = (int) $a->condition_value;
@endphp
{{ $a->icon }}
{{ $a->name }}
@if ($a->available_to)
⏳ {{ __('Ограниченное: до :date', ['date' => date('d.m.Y', strtotime($a->available_to))]) }}
@endif
{{ $a->description }}
@if (! empty($a->reward_item_name))
{{-- Earned frame (128): claiming unlocks it in the shop. --}}
@php($fr = \App\Support\Cosmetics::frame($a->reward_item_value, 3))
🦸
🎁 {{ $a->reward_item_name }}
@endif
@endforeach
@endforeach
{{-- position:fixed, so its spot in the DOM doesn't affect where it renders. --}}
@endsection
@push('scripts')
@endpush