refactor: remove global RateCardProfile singleton usage from controllers and delete unused welcome view
This commit is contained in:
@@ -111,6 +111,63 @@
|
||||
gap: 14px;
|
||||
}
|
||||
|
||||
.carousel-wrapper {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.carousel-track {
|
||||
display: flex;
|
||||
overflow-x: auto;
|
||||
scroll-snap-type: x mandatory;
|
||||
gap: 14px;
|
||||
padding-bottom: 10px;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
|
||||
.carousel-track::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.carousel-slide {
|
||||
flex: 0 0 220px;
|
||||
scroll-snap-align: start;
|
||||
}
|
||||
|
||||
.carousel-btn {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
background: white;
|
||||
border: 1px solid rgba(0,0,0,0.05);
|
||||
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
|
||||
color:
|
||||
{{ $profile->accent_color }}
|
||||
;
|
||||
font-size: 20px;
|
||||
font-weight: 900;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.carousel-btn:hover {
|
||||
background: #fdfdfd;
|
||||
box-shadow: 0 6px 14px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.carousel-btn.prev {
|
||||
left: -20px;
|
||||
}
|
||||
|
||||
.carousel-btn.next {
|
||||
right: -20px;
|
||||
}
|
||||
|
||||
.card {
|
||||
background: white;
|
||||
border-radius: 24px;
|
||||
@@ -123,6 +180,17 @@
|
||||
22;
|
||||
}
|
||||
|
||||
.popup-modal {
|
||||
position: fixed;
|
||||
inset: 0;
|
||||
background: rgba(0, 0, 0, 0.8);
|
||||
z-index: 9999;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.service {
|
||||
font-weight: 700;
|
||||
color: #1F2937;
|
||||
@@ -337,22 +405,32 @@
|
||||
@if(!empty($publicShowcase))
|
||||
<div class="platform-section" style="margin-top:40px;">
|
||||
<div class="platform-title" style="justify-content:center;">Content Showcase</div>
|
||||
<div class="cards">
|
||||
@php $isCarousel = count($publicShowcase) >= 3; @endphp
|
||||
@if($isCarousel)
|
||||
<div class="carousel-wrapper" x-data="{
|
||||
scrollPrev() { $refs.slider.scrollBy({left: -234, behavior: 'smooth'}); },
|
||||
scrollNext() { $refs.slider.scrollBy({left: 234, behavior: 'smooth'}); }
|
||||
}">
|
||||
<button type="button" class="carousel-btn prev" @click="scrollPrev()">❮</button>
|
||||
<div class="carousel-track" x-ref="slider">
|
||||
@else
|
||||
<div class="cards">
|
||||
@endif
|
||||
@foreach($publicShowcase as $item)
|
||||
@php
|
||||
$isUrl = ($item['file_id'] === 'url');
|
||||
$file = !$isUrl ? \App\Models\MediaFile::find($item['file_id']) : null;
|
||||
@endphp
|
||||
@if($file || $isUrl)
|
||||
<div class="card" style="padding:0; overflow:hidden; display:flex; flex-direction:column;">
|
||||
<div class="card {{ $isCarousel ? 'carousel-slide' : '' }}" style="padding:0; overflow:hidden; display:flex; flex-direction:column;">
|
||||
<div style="flex:1; background:#F9FAFB; display:flex; align-items:center; justify-content:center; position:relative;">
|
||||
@if(!empty($item['thumbnail_path']))
|
||||
@if(!$isUrl && $file->is_image)
|
||||
<div style="width:100%; height:180px; cursor:pointer; position:relative;" @click="popupImage = '{{ $file->url }}'; popupOpen = true;">
|
||||
<div style="width:100%; aspect-ratio:9/16; cursor:pointer; position:relative;" @click="popupImage = '{{ $file->url }}'; popupOpen = true;">
|
||||
<img src="{{ asset('storage/' . $item['thumbnail_path']) }}" style="width:100%; height:100%; object-fit:cover; display:block;">
|
||||
</div>
|
||||
@else
|
||||
<a href="{{ $isUrl ? ($item['url'] ?? '#') : $file->url }}" target="_blank" style="display:block; width:100%; height:180px; position:relative;">
|
||||
<a href="{{ $isUrl ? ($item['url'] ?? '#') : $file->url }}" target="_blank" style="display:block; width:100%; aspect-ratio:9/16; position:relative;">
|
||||
<img src="{{ asset('storage/' . $item['thumbnail_path']) }}" style="width:100%; height:100%; object-fit:cover; display:block;">
|
||||
@if(!$isUrl && $file->is_video)
|
||||
<div style="position:absolute; inset:0; display:flex; align-items:center; justify-content:center; background:rgba(0,0,0,0.2);">
|
||||
@@ -362,19 +440,19 @@
|
||||
</a>
|
||||
@endif
|
||||
@elseif($isUrl)
|
||||
<div style="height:180px; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; text-align:center;">
|
||||
<div style="aspect-ratio:9/16; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; text-align:center;">
|
||||
<span style="font-size:48px;">🌐</span>
|
||||
<a href="{{ $item['url'] ?? '#' }}" target="_blank" style="margin-top:10px; font-size:12px; color:{{ $profile->accent_color }}; text-decoration:none; font-weight:700;">Open Link</a>
|
||||
</div>
|
||||
@else
|
||||
@if($file->is_image)
|
||||
<div style="width:100%; height:180px; cursor:pointer;" @click="popupImage = '{{ $file->url }}'; popupOpen = true;">
|
||||
<div style="width:100%; aspect-ratio:9/16; cursor:pointer;" @click="popupImage = '{{ $file->url }}'; popupOpen = true;">
|
||||
<img src="{{ $file->url }}" style="width:100%; height:100%; object-fit:cover; display:block;">
|
||||
</div>
|
||||
@elseif($file->is_video)
|
||||
<video src="{{ $file->url }}" style="width:100%; height:180px; object-fit:cover; display:block;" controls></video>
|
||||
<video src="{{ $file->url }}" style="width:100%; aspect-ratio:9/16; object-fit:cover; display:block;" controls></video>
|
||||
@else
|
||||
<div style="height:180px; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; text-align:center;">
|
||||
<div style="aspect-ratio:9/16; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:20px; text-align:center;">
|
||||
<span style="font-size:48px;">{{ $file->icon }}</span>
|
||||
<a href="{{ $file->url }}" target="_blank" style="margin-top:10px; font-size:12px; color:{{ $profile->accent_color }}; text-decoration:none; font-weight:700;">View File</a>
|
||||
</div>
|
||||
@@ -387,7 +465,13 @@
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
@if($isCarousel)
|
||||
</div>
|
||||
<button type="button" class="carousel-btn next" @click="scrollNext()">❯</button>
|
||||
</div>
|
||||
@else
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@@ -406,7 +490,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Image Popup Modal -->
|
||||
<div x-show="popupOpen" x-transition.opacity style="display:none; position:fixed; inset:0; background:rgba(0,0,0,0.8); z-index:9999; align-items:center; justify-content:center; padding:20px;" :style="popupOpen ? 'display:flex' : 'display:none'">
|
||||
<div x-show="popupOpen" x-transition.opacity style="display:none;" class="popup-modal">
|
||||
<div style="position:absolute; inset:0; cursor:pointer;" @click="popupOpen = false"></div>
|
||||
<img :src="popupImage" style="max-width:100%; max-height:100%; object-fit:contain; position:relative; z-index:10000; border-radius:12px; box-shadow:0 10px 25px rgba(0,0,0,0.5);">
|
||||
<button @click="popupOpen = false" style="position:absolute; top:20px; right:20px; background:rgba(255,255,255,0.2); border:none; color:white; font-size:30px; width:40px; height:40px; border-radius:50%; cursor:pointer; z-index:10001; display:flex; align-items:center; justify-content:center;">×</button>
|
||||
|
||||
Reference in New Issue
Block a user