preview while processing
This commit is contained in:
parent
8d1faefb45
commit
46d26ce240
@ -50,7 +50,7 @@ class CameraCapture extends Component
|
||||
{
|
||||
$recentPhotos = PhotoJob::latest()->take(10)->get()->map(fn($job) => [
|
||||
'id' => $job->id,
|
||||
'url' => Storage::disk('public')->url($job->image_path),
|
||||
'url' => Storage::disk('public')->url($job->image_path) . '?v=' . $job->updated_at->timestamp,
|
||||
'status' => $job->status,
|
||||
]);
|
||||
|
||||
|
||||
@ -32,11 +32,15 @@
|
||||
@foreach ($recentPhotos as $photo)
|
||||
<div class="relative">
|
||||
@if ($photo['status'] === 'processing')
|
||||
<div class="w-full aspect-square rounded-lg border border-gray-700 bg-gray-900 flex flex-col items-center justify-center gap-2">
|
||||
<svg class="w-8 h-8 text-gray-500 animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v8H4z"/>
|
||||
</svg>
|
||||
<div class="relative w-full aspect-square">
|
||||
<img src="{{ $photo['url'] }}" alt="Photo #{{ $photo['id'] }}"
|
||||
class="w-full aspect-square object-cover rounded-lg border border-gray-700">
|
||||
<div class="absolute inset-0 rounded-lg bg-black/50 flex items-center justify-center">
|
||||
<svg class="w-8 h-8 text-white animate-spin" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"/>
|
||||
<path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8v8H4z"/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<img src="{{ $photo['url'] }}" alt="Photo #{{ $photo['id'] }}"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user