Skip to content

Commit

Permalink
fix: more lazy loading optimisations
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Aug 7, 2024
1 parent 57be610 commit 9ebdd45
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion resources/views/livewire/collection-list.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ class="h-full w-full border-transparent py-2 pl-8 pr-3 text-sm text-gray-900 pla
@foreach ($collections as $collection)
<a href="search?type=tags&amp;q={{ $collection->title }}&amp;tagType=dataSource" class="relative border mb-5 flex h-80 w-56 flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="https://s3.uni-jena.de/coconut/{{ $collection->image }}" alt="{{ $collection->title }}">
@if($collection['image'] && $collection['image'] != '')
<img src="https://s3.uni-jena.de/coconut/{{ $collection->image }}" alt="{{ $collection->title }}">
@endif
</span>
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-left text-xl font-bold text-dark">{{ $collection->title }}</span>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/livewire/compound-classes.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div>
<div class="my-1 w-full mx-auto px-8 max-w-4xl lg:max-w-7xl">
<div class="my-1 w-full mx-auto px-8 pb-5 max-w-4xl lg:max-w-7xl">
<div class="mb-4 border-gray-200 py-5 sm:flex sm:items-center sm:justify-between">
<h2 class="text-2xl pb-0 font-bold tracking-tight text-white sm:text-2xl"><span
class="-mb-1 block text-primary-dark bg-clip-text">Compound Classes</span></h2>
Expand Down
5 changes: 3 additions & 2 deletions resources/views/livewire/data-sources.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,9 @@ class="-mb-1 block text-primary-dark bg-clip-text">Data Sources</span></h2>
@foreach ($collections as $collection)
<a href="search?type=tags&amp;q={{ $collection['title'] }}&amp;tagType=dataSource" class="relative border mb-5 flex h-80 w-full flex-col overflow-hidden rounded-lg p-6 hover:opacity-75 xl:w-auto">
<span aria-hidden="true" class="absolute inset-0">
<img src="https://s3.uni-jena.de/coconut/{{ $collection['image'] }}" alt="{{ $collection['title'] }}">

@if($collection['image'] && $collection['image'] != '')
<img src="https://s3.uni-jena.de/coconut/{{ $collection->image }}" alt="{{ $collection->title }}">
@endif
</span>
<span aria-hidden="true" class="absolute inset-x-0 bottom-0 h-2/3 bg-gradient-to-t from-gray-800 opacity-50"></span>
<span class="relative mt-auto text-center text-xl font-bold text-dark">{{ $collection['title'] }}</span>
Expand Down
8 changes: 4 additions & 4 deletions resources/views/livewire/welcome.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class="rounded-md bg-secondary-dark px-3.5 py-1.5 text-base font-semibold leadin
</svg>
&nbsp;Search</button>
</div>
<livewire:structure-editor />
<livewire:structure-editor lazy="on-load"/>
</div>
</div>
</div>
Expand Down Expand Up @@ -349,9 +349,9 @@ class="border bg-gray-50 justify-center items-center text-center rounded-md text
</div>
</div>
<livewire:recent-molecules lazy />
<livewire:compound-classes lazy />
<livewire:data-sources lazy />
<livewire:faqs lazy/>
<livewire:compound-classes lazy="on-load" />
<livewire:data-sources lazy="on-load" />
<livewire:faqs lazy="on-load" />

<div class="bg-gray-900 border-y">
<div
Expand Down

0 comments on commit 9ebdd45

Please sign in to comment.