Skip to content

Commit baa04d2

Browse files
feat:[lar-156] Add lazy loading in img
1 parent c602a48 commit baa04d2

File tree

12 files changed

+22
-6
lines changed

12 files changed

+22
-6
lines changed

resources/views/components/articles/card-author.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<article class="relative" wire:key="{{ $article->slug }}">
1212
<div class="relative w-full">
1313
<img
14+
loading="lazy"
1415
src="{{ $media }}"
1516
alt="{{ $article->title }}"
1617
class="aspect-[16/9] w-full rounded-2xl bg-gray-100 object-cover sm:aspect-[2/1] dark:bg-gray-800"

resources/views/components/articles/card.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
@if(! $isSummary)
1717
<div class="aspect-[2/1] w-full rounded-lg bg-gray-100 overflow-hidden shadow-sm transition group-hover:opacity-80">
1818
<img
19+
loading="lazy"
1920
class="rounded-lg object-cover shadow-sm group-hover:opacity-75"
2021
src="{{ $media }}"
2122
alt="{{ $article->title }}"

resources/views/components/articles/overview.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class="space-y-4 lg:grid lg:grid-cols-3 lg:items-start lg:gap-6 lg:space-y-0"
1515
<x-link :href="route('articles.show', $article)" class="group">
1616
<div class="aspect-h-2 aspect-w-3">
1717
<img
18+
loading="lazy"
1819
class="rounded-lg object-cover shadow-lg group-hover:opacity-75"
1920
src="{{ $media }}"
2021
alt="{{ $article->title }}"

resources/views/components/dropdown-profile.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ class="group flex items-center gap-2 py-1.5 text-sm font-medium text-gray-500 da
6060
role="menuitem"
6161
tabindex="-1"
6262
>
63-
<img class="size-5 object-cover" src="{{ asset('images/filament-icon.png') }}" alt="Filament icon" />
64-
Administration
63+
<img loading="lazy" class="size-5 object-cover" src="{{ asset('images/filament-icon.png') }}" alt="Filament icon" />
64+
{{ __('Administration') }}
6565
</x-link>
6666
</div>
6767
@endif

resources/views/components/feeds/comment.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<div class="relative flex items-start space-x-3">
33
<div class="relative">
44
<img
5+
loading="lazy"
56
class="flex size-10 items-center justify-center rounded-full bg-white dark:bg-gray-800 ring-4 ring-white dark:ring-white/10"
67
src="{{ $user->profile_photo_url }}"
78
alt="Avatar de {{ $user->username }}"

resources/views/components/layouts/footer.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
</a>
1212
<span class="ml-1.5">{{ __('global.by') }} Caneco</span>
1313
<img
14+
loading="lazy"
1415
class="ml-2 size-6 rounded-full"
1516
src="https://avatars.githubusercontent.com/u/502041"
1617
alt="Caneco avatar"

resources/views/components/layouts/header.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ class="group inline-flex items-center"
2020
@if(isHolidayWeek())
2121
<div class="relative">
2222
<div class="absolute z-0 lg:left-1/4">
23-
<img src="{{ asset('images/decoration.gif') }}" class="w-auto h-10" alt="Christmas decoration">
23+
<img loading="lazy" src="{{ asset('images/decoration.gif') }}" class="w-auto h-10" alt="Christmas decoration">
2424
</div>
2525
<div class="absolute z-0 lg:right-12">
26-
<img src="{{ asset('images/decoration.gif') }}" class="w-auto h-10" alt="Christmas decoration">
26+
<img loading="lazy" src="{{ asset('images/decoration.gif') }}" class="w-auto h-10" alt="Christmas decoration">
2727
</div>
2828
</div>
2929
@endif

resources/views/components/user/avatar.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
@if ($user->is_sponsor)
88
<span @class(['relative inline-block', $container])>
99
<img
10+
loading="lazy"
1011
{{ $attributes->twMerge(['class' => 'object-cover bg-gray-100 dark:bg-gray-900 rounded-full ring-2 !ring-flag-yellow']) }}
1112
src="{{ $user->profile_photo_url }}"
1213
alt="{{ $user->username() }}"
@@ -28,6 +29,7 @@ class="size-full text-yellow-500"
2829
</span>
2930
@else
3031
<img
32+
loading="lazy"
3133
{{ $attributes->merge(['class' => 'object-cover rounded-full bg-gray-100 dark:bg-gray-900']) }}
3234
src="{{ $user->profile_photo_url }}"
3335
alt="{{ $user->username() }}"

resources/views/livewire/pages/about.blade.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class="mt-2 block text-2xl font-extrabold tracking-tight sm:text-3xl xl:text-4xl
150150
<div class="mt-14 columns-2 gap-4 sm:columns-3 lg:mt-0">
151151
<div class="relative">
152152
<img
153+
loading="lazy"
153154
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703778123/IMG_1637_yjaqrk.jpg"
154155
alt=""
155156
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg"
@@ -160,6 +161,7 @@ class="pointer-events-none absolute inset-0 rounded-xl ring-1 ring-inset ring-gr
160161
</div>
161162
<div class="relative">
162163
<img
164+
loading="lazy"
163165
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703778121/IMG_1505_j06cwz.jpg"
164166
alt=""
165167
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg lg:aspect-[1/2]"
@@ -170,6 +172,7 @@ class="pointer-events-none absolute inset-0 rounded-xl ring-1 ring-inset ring-gr
170172
</div>
171173
<div class="relative">
172174
<img
175+
loading="lazy"
173176
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703778122/IMG_1609_otohw5.jpg"
174177
alt=""
175178
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg lg:aspect-[2/5]"
@@ -180,6 +183,7 @@ class="pointer-events-none absolute inset-0 rounded-xl ring-1 ring-inset ring-gr
180183
</div>
181184
<div class="relative">
182185
<img
186+
loading="lazy"
183187
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703778121/IMG_1605_zdgdpv.jpg"
184188
alt=""
185189
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg lg:aspect-[4/5]"
@@ -190,6 +194,7 @@ class="pointer-events-none absolute inset-0 rounded-xl ring-1 ring-inset ring-gr
190194
</div>
191195
<div class="relative">
192196
<img
197+
loading="lazy"
193198
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703778122/IMG_1567_hfy747.jpg"
194199
alt=""
195200
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg"
@@ -200,6 +205,7 @@ class="pointer-events-none absolute inset-0 rounded-xl ring-1 ring-inset ring-gr
200205
</div>
201206
<div class="relative">
202207
<img
208+
loading="lazy"
203209
src="https://res.cloudinary.com/dlzdb3m6n/image/upload/v1703782759/phnnfnzxt8khtrth4qem.jpg"
204210
alt=""
205211
class="aspect-[2/3] w-full rounded-xl bg-gray-900/5 object-cover shadow-lg lg:aspect-[3/7]"
@@ -232,7 +238,7 @@ class="space-y-12 sm:grid sm:grid-cols-2 sm:gap-x-6 sm:gap-y-12 sm:space-y-0 lg:
232238
@foreach($profiles as $profile)
233239
<li>
234240
<div class="space-y-4">
235-
<img class="h-16 w-16 rounded-full lg:h-20 lg:w-20" src="{{ $profile['avatar'] }}" alt="{{ $profile['name'] }}" />
241+
<img loading="lazy" class="h-16 w-16 rounded-full lg:h-20 lg:w-20" src="{{ $profile['avatar'] }}" alt="{{ $profile['name'] }}" />
236242
<div class="space-y-1 text-lg font-medium leading-6 text-gray-900">
237243
<h3>{{ $profile['name'] }}</h3>
238244
<p class="font-sans text-base text-green-600">{{ $profile['title'] }}</p>

resources/views/livewire/pages/home.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ class="font-medium text-flag-green hover:text-green-500 hover:underline"
174174
<div class="h-full w-full xl:grid xl:grid-cols-2">
175175
<div class="h-full xl:relative xl:col-start-2">
176176
<img
177+
loading="lazy"
177178
class="h-full w-full object-cover opacity-25 xl:absolute xl:inset-0"
178179
src="{{ asset('/images/developer.jpg') }}"
179180
alt="Developer working on laptop"

resources/views/livewire/pages/sponsoring.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@
5959
<div class="mt-4 flex flex-wrap items-center gap-6">
6060
<a href="https://laravelshopper.dev" target="_blank" class="flex items-center">
6161
<img
62+
loading="lazy"
6263
class="h-10 dark:hidden"
6364
src="{{ asset('/images/sponsors/shopper-logo.svg') }}"
6465
alt="Laravel Shopper"
6566
/>
6667
<img
68+
loading="lazy"
6769
class="hidden h-10 dark:block"
6870
src="{{ asset('/images/sponsors/shopper-logo-light.svg') }}"
6971
alt="Laravel Shopper"

resources/views/vendor/mail/html/header.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<td class="header">
33
<a href="{{ $url }}" style="display: inline-block">
44
@if (trim($slot) === 'Laravel')
5-
<img src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Cameroun logo" />
5+
<img loading="lazy" src="https://laravel.com/img/notification-logo.png" class="logo" alt="Laravel Cameroun logo" />
66
@else
77
{{ $slot }}
88
@endif

0 commit comments

Comments
 (0)