GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: /var/www/html/resources/views/livewire/pages/show-shop-services.blade.php
<div>
    <br>
    <br>
    <section class="breadcumb-section pt-10">
        <div class="container">
            <div class="row">
                <div class="col-lg-12">
                    <div class="breadcumb-style1">
                        <div class="breadcumb-list">
                            <a href="{{ route('welcome') }}">Home</a>
                            <a href="{{ route('services.page') }}">Services</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- Breadcumb Sections -->


    <section class="our-cta bgc-thm4 pt90 pb90 pt60-md pb60-md mt100 mt0-lg">
        <div class="container">
            <div class="row justify-content-between">
                <div class="col-md-6 col-lg-7 col-xl-5 wow fadeInLeft">
                    <div x-data="{ 
                            fullDescription: @js($shop['description'] ?? ''), 
                            displayedLength: 500 
                        }" class="cta-style3">
                        <h2 class="cta-title">{{ $shop['name'] }}</h2>
                        <p class="cta-text">
                            <span x-text="fullDescription.substring(0, displayedLength)"></span>
                            <span x-show="displayedLength < fullDescription.length">...</span>
                        </p>
                        <button
                            x-show="displayedLength < fullDescription.length"
                            @click="displayedLength += 500"
                            class="ud-btn btn-thm2">
                            See More <i class="fal fa-arrow-right-long"></i>
                        </button>
                    </div>

                </div>
                <div class="col-md-6 col-lg-5 col-xl-5 position-relative wow zoomIn">
                    <div class="cta-img">
                        <img class="w-100" src="{{ $shop['workshop_photo_urls'][0] }}" alt="{{$shop['name']}}">
                    </div>
                </div>
            </div>
        </div>
    </section>

    <style>
        .dim-image {
            filter: brightness(50%);
            /* Adjust the brightness (0% is completely dark, 100% is default) */
            transition: filter 0.3s ease;
            /* Smooth transition effect */
        }

        .dim-image:hover {
            filter: brightness(70%);
            /* Slightly brighten on hover */
        }
    </style>


    <div class="search-modal">
        <div class="modal fade" id="imagePreviewModal" aria-hidden="true" aria-labelledby="imagePreviewModalLabel"
            tabindex="-1">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <h5 class="modal-title" id="imagePreviewModalLabel"></h5>
                        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"><i
                                class="fal fa-xmark"></i></button>
                    </div>
                    <div class="modal-body">
                        @foreach($shop['workshop_photo_urls'] as $photo)
                        <div class="item">
                            <img src="{{ $photo }}" alt="{{$shop['name']}}" class="img-fluid">
                        </div>
                        @endforeach
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="row px-4 py-2">
        <h2 class="mb-4">Services</h2>
        <div class="col-lg-12">
            @if ($gigs)
            <div class="row">
                @foreach ($gigs as $gig)

                <div class="col-6 col-md-3 mb-4">
                    @php
                    // Get a random image from the gig's image URLs
                    $imageUrls = $gig['image_urls'];
                    $randomImageUrl = $imageUrls[array_rand($imageUrls)];

                    // Calculate the average star rating
                    $reviews = $gig['reviews'];
                    $totalReviews = count($reviews);
                    $sumRatings = array_sum(array_column($reviews, 'star_rating'));
                    $averageRating = $totalReviews > 0 ? $sumRatings / $totalReviews : 0;
                    @endphp
                    <div class="item">
                        <div class="listing-style1 bdrs16">
                            <div class="list-thumb">
                                <a
                                    href="{{ route('show.service.page', $gig['slug']) }}"> <img style="width: 100%; height: 120px; object-fit: cover;" src="{{ $randomImageUrl }}"
                                        alt="{{ $gig['title'] }}"> </a>
                                <a href="{{route('add.favorite', $gig['slug'])}}" class="listing-fav fz12"><span class="far fa-heart"></span></a>
                            </div>
                            <div class="list-content">

                                <h5 class="list-title line-clamp2"><a
                                        href="{{ route('show.service.page', $gig['slug']) }}">{{ $gig['title'] }}</a>
                                </h5>
                                <div class="review-meta d-flex align-items-center">
                                    @if ($averageRating > 0)
                                    <i class="fas fa-star fz10 review-color me-1"></i>
                                    <p class="mb-0 body-color fz14"><span
                                            class="dark-color me-1">{{ number_format($averageRating, 1) }}</span></p>
                                    @endif
                                </div>
                                <hr class="my-2">
                                <div class="list-meta d-flex justify-content-between align-items-center mt15">

                                    <div class="budget">
                                        <p class="mb-0 body-color"><span
                                                class="fz17 fw500 dark-color ms-1">{{ $gig['currency'] }}{{ number_format($gig['price']) }}</span>
                                        </p>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                @endforeach
            </div>
            @else
            <div class="text-center text-lg-center mb-4">
                <a class="ud-btn btn-light-thm bdrs90" href="{{route('category.page')}}">No services found. Please check back</a>
            </div>
            @endif
        </div>
    </div>

</div>