Skip to content

Instantly share code, notes, and snippets.

@benbjurstrom
Created December 27, 2023 18:25
Show Gist options
  • Save benbjurstrom/e6978a12a2ce08459756f53e47e66e24 to your computer and use it in GitHub Desktop.
Save benbjurstrom/e6978a12a2ce08459756f53e47e66e24 to your computer and use it in GitHub Desktop.
Laravel Blade Image Component
<div @class(['overflow-hidden', $class])>
<div
class="blur-lg bg-cover bg-no-repeat"
style="background-image: url('{{$placeholder}}');"
>
<img
:key="{{$id}}"
class="h-full w-full transition duration-200 ease-in opacity-0"
src="{{$src}}"
onload="this.classList.remove('opacity-0');
this.parentNode.classList.remove('blur-lg');"
>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment