feat: add bust-out card to jail page

Add interactive Bust Out card to jail view with:
- Success chance and cost display
- Conditional button state (active when funds sufficient, disabled otherwise)
- Form submission to game.jail.bust-out route with CSRF protection
- Flash message support for success/error feedback
- Cash on hand display in status card
- Dark crime theme styling with yellow prison colors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Doar Mihai
2026-06-28 22:57:01 +03:00
co-authored by Claude Sonnet 4.6
parent f84a303c76
commit f6e7d37428
+59 -2
View File
@@ -3,7 +3,20 @@
@section('title', 'Jail') @section('title', 'Jail')
@section('game-content') @section('game-content')
<div class="max-w-2xl mx-auto"> <div class="max-w-2xl mx-auto space-y-4">
{{-- Flash messages --}}
@if(session('success'))
<div class="bg-green-900/30 border border-green-700 text-green-300 rounded-lg px-4 py-3 text-sm">
{{ session('success') }}
</div>
@endif
@if(session('error'))
<div class="bg-red-900/30 border border-red-700 text-red-300 rounded-lg px-4 py-3 text-sm">
{{ session('error') }}
</div>
@endif
<div class="bg-syndicate-800 border border-syndicate-700 rounded-lg"> <div class="bg-syndicate-800 border border-syndicate-700 rounded-lg">
<div class="p-8 text-center"> <div class="p-8 text-center">
<div class="mb-6"> <div class="mb-6">
@@ -13,6 +26,7 @@
<h1 class="font-display text-2xl font-bold text-gray-100 mb-4">You're in Jail</h1> <h1 class="font-display text-2xl font-bold text-gray-100 mb-4">You're in Jail</h1>
<p class="text-gray-400 mb-6 text-sm">Your character has been arrested and is currently serving time.</p> <p class="text-gray-400 mb-6 text-sm">Your character has been arrested and is currently serving time.</p>
{{-- Status card --}}
<div class="bg-yellow-900/20 border border-yellow-800 rounded-lg p-6 mb-6 text-left"> <div class="bg-yellow-900/20 border border-yellow-800 rounded-lg p-6 mb-6 text-left">
<h3 class="font-display text-base font-semibold text-yellow-300 mb-3">Your Status</h3> <h3 class="font-display text-base font-semibold text-yellow-300 mb-3">Your Status</h3>
<div class="space-y-2 text-sm"> <div class="space-y-2 text-sm">
@@ -24,11 +38,54 @@
<span class="text-gray-400">Release Time</span> <span class="text-gray-400">Release Time</span>
<span class="text-gray-200 font-medium">{{ $releaseTime }}</span> <span class="text-gray-200 font-medium">{{ $releaseTime }}</span>
</div> </div>
<div class="flex justify-between">
<span class="text-gray-400">Cash on Hand</span>
<span class="text-gray-200 font-medium">${{ number_format($character->money) }}</span>
</div>
</div> </div>
</div> </div>
{{-- Bust Out card --}}
<div class="bg-syndicate-700 border border-syndicate-600 rounded-lg p-6 mb-6 text-left">
<h3 class="font-display text-base font-semibold text-gray-100 mb-1">Bust Out</h3>
<p class="text-gray-400 text-xs mb-4">Spend cash for a chance to escape early. Failure extends your sentence.</p>
<div class="space-y-2 text-sm mb-4">
<div class="flex justify-between">
<span class="text-gray-400">Success Chance</span>
<span class="text-yellow-400 font-medium">{{ $bustOutChance }}%</span>
</div>
<div class="flex justify-between">
<span class="text-gray-400">Cost</span>
<span class="text-gray-200 font-medium">${{ number_format($bustOutCost) }}</span>
</div>
<div class="flex justify-between">
<span class="text-gray-400">On Failure</span>
<span class="text-red-400 font-medium">Sentence × 1.5</span>
</div>
</div>
@if($character->money >= $bustOutCost)
<form action="{{ route('game.jail.bust-out') }}" method="POST">
@csrf
<button type="submit"
class="w-full flex items-center justify-center px-6 py-3 bg-yellow-700 hover:bg-yellow-600 text-white font-medium rounded-lg transition">
<span class="mr-2">🔓</span>
Bust Out ({{ $bustOutChance }}% chance)
</button>
</form>
@else
<button type="button" disabled
title="You need ${{ number_format($bustOutCost) }} to attempt a bust-out"
class="w-full flex items-center justify-center px-6 py-3 bg-syndicate-600 text-gray-500 font-medium rounded-lg cursor-not-allowed">
<span class="mr-2">🔒</span>
Not Enough Cash
</button>
@endif
</div>
<div class="space-y-4"> <div class="space-y-4">
<p class="text-sm text-gray-600">You must wait for your sentence to complete.</p> <p class="text-sm text-gray-600">Or wait for your sentence to complete automatically.</p>
<a href="{{ route('game.dashboard') }}" <a href="{{ route('game.dashboard') }}"
class="inline-flex items-center text-gray-500 hover:text-gray-300 transition text-sm"> class="inline-flex items-center text-gray-500 hover:text-gray-300 transition text-sm">