From 790b8d280f972d7faca9f91ef3c13c19303f7461 Mon Sep 17 00:00:00 2001 From: Rico van Zelst Date: Tue, 7 Nov 2023 19:38:34 +0100 Subject: [PATCH] feat: image load animation --- resources/js/app.js | 11 +++++++++++ .../views/components/champions/list_all.blade.php | 7 ++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 0f97a1b..50db69d 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -3,3 +3,14 @@ import "flowbite"; import "./icons"; import "./icons-brands"; import "./icons-duotone"; + +document.addEventListener("DOMContentLoaded", function () { + const images = document.querySelectorAll(".transition-opacity"); + + images.forEach((image) => { + image.onload = function () { + image.style.filter = "blur(0)"; + image.style.opacity = "1"; + }; + }); +}); diff --git a/resources/views/components/champions/list_all.blade.php b/resources/views/components/champions/list_all.blade.php index 4f1a21f..0cb61de 100644 --- a/resources/views/components/champions/list_all.blade.php +++ b/resources/views/components/champions/list_all.blade.php @@ -19,15 +19,16 @@ border border-stone-800 hover:border-orange-500/10 hover:shadow-orange-500/10">
- {{ $champion->name }} Splash Art
+
-

+

{{ $champion->name }}

{{ $champion->title }}