Skip to content

Commit

Permalink
use generic js
Browse files Browse the repository at this point in the history
  • Loading branch information
QuentinGab committed Jan 10, 2024
1 parent 0400928 commit 0297854
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions resources/views/components/img.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,5 @@
height="{{ $media->getHeight($conversion) }}" width="{{ $media->getWidth($conversion) }}"
alt="{{ $media->getName($conversion) }}"
@if ($responsive) srcset="{{ $media->getSrcset($conversion)->join(', ') }}"
x-data="{
sizes: '1px',
resize() {
this.$nextTick(() => {
setTimeout(() => {
size = this.$el.getBoundingClientRect().width ?? 1;
this.sizes = Math.ceil(size / window.innerWidth * 100) + 'vw';
}, 50);
});
}
}"
x-intersect.once="resize" x-bind:sizes="sizes" @endif>
onload="window.requestAnimationFrame(function(){if(!(size=getBoundingClientRect().width))return;onload=null;sizes=Math.ceil(size/window.innerWidth*100)+'vw';});"
sizes="1px" @endif>

0 comments on commit 0297854

Please sign in to comment.