added the cropping library
This commit is contained in:
1 parent
c1fc28087e
commit
7a18eb6588
13 files changed
+887
-192
No files matched your search
@@ -12,14 +12,40 @@
|
||||
<!-- Profile Picture Section -->
|
||||
<div class="mb-4 text-center">
|
||||
<div class="mb-3">
|
||||
<img src="{{ $user->profile_picture ? asset('storage/' . $user->profile_picture) : asset('images/default-avatar.png') }}"
|
||||
alt="Profile Picture"
|
||||
class="rounded-circle"
|
||||
style="width: 120px; height: 120px; object-fit: cover; border: 3px solid #dee2e6;">
|
||||
@if($user->profile_picture && file_exists(public_path('storage/' . $user->profile_picture)))
|
||||
<img src="{{ asset('storage/' . $user->profile_picture) }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.png')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.png') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.jpg')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.jpg') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@elseif(file_exists(public_path('storage/images/profiles/profile_' . $user->id . '.jpeg')))
|
||||
<img src="{{ asset('storage/images/profiles/profile_' . $user->id . '.jpeg') }}"
|
||||
alt="Profile Picture"
|
||||
style="width: 300px; height: 400px; object-fit: cover; border: 3px solid #dee2e6; border-radius: 8px;">
|
||||
@else
|
||||
<div style="width: 300px; height: 400px; background-color: #f0f0f0; border: 3px solid #dee2e6; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 0 auto;">
|
||||
<div class="text-center">
|
||||
<i class="bi bi-person-circle" style="font-size: 100px; color: #dee2e6;"></i>
|
||||
<p class="text-muted mt-2">No profile picture</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<button type="button" class="btn btn-outline-primary btn-sm" data-bs-toggle="modal" data-bs-target="#profilePictureModal">
|
||||
<i class="fas fa-camera"></i> Change Profile Picture
|
||||
</button>
|
||||
<x-takeone-cropper
|
||||
id="profile_picture"
|
||||
width="300"
|
||||
height="400"
|
||||
shape="square"
|
||||
folder="images/profiles"
|
||||
filename="profile_{{ $user->id }}"
|
||||
uploadUrl="{{ route('profile.upload-picture') }}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ route('profile.update') }}">
|
||||
@@ -196,14 +222,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Profile Picture Upload Modal -->
|
||||
<x-image-upload-modal
|
||||
id="profilePictureModal"
|
||||
aspectRatio="1"
|
||||
maxSizeMB="1"
|
||||
title="Upload Profile Picture"
|
||||
uploadUrl="{{ route('profile.upload-picture') }}"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@push('scripts')
|
||||
|
||||
@@ -42,8 +42,8 @@
|
||||
<div class="d-flex">
|
||||
<!-- Profile Picture -->
|
||||
<div style="width: 180px; min-height: 250px; border-radius: 0.375rem 0 0 0.375rem;">
|
||||
@if($relationship->dependent->media_gallery[0] ?? false)
|
||||
<img src="{{ $relationship->dependent->media_gallery[0] }}" alt="{{ $relationship->dependent->full_name }}" class="w-100 h-100" style="object-fit: cover; border-radius: 0.375rem 0 0 0.375rem;">
|
||||
@if($relationship->dependent->profile_picture)
|
||||
<img src="{{ asset('storage/' . $relationship->dependent->profile_picture) }}" alt="{{ $relationship->dependent->full_name }}" class="w-100 h-100" style="object-fit: cover; border-radius: 0.375rem 0 0 0.375rem;">
|
||||
@else
|
||||
<div class="w-100 h-100 d-flex align-items-center justify-content-center text-white fw-bold" style="font-size: 3rem; background: linear-gradient(135deg, {{ $relationship->dependent->gender == 'm' ? '#0d6efd 0%, #0a58ca 100%' : '#d63384 0%, #a61e4d 100%' }}); border-radius: 0.375rem 0 0 0.375rem;">
|
||||
{{ strtoupper(substr($relationship->dependent->full_name, 0, 1)) }}
|
||||
|
||||
Reference in new issue
Block a user