myPicture without js

This commit is contained in:
lesion
2022-05-09 16:31:53 +02:00
parent 2e365ab698
commit 7c75ac3e56

View File

@@ -1,23 +1,17 @@
<template>
<div :class='{ thumb, img: true }'
:height="height" :width="width"
:style="backgroundPreview">
<div :class='{ img: true, thumb }'>
<img
v-if='media'
:class='{ "u-featured": true, loading: true }'
:class='{ "u-featured": true }'
:alt='media.name' :loading='lazy?"lazy":"eager"'
:src="src"
:srcset="srcset"
itemprop="image"
:height="height" :width="width"
:style="{ 'object-position': thumbnailPosition }"
onload="this.classList.remove('loading')">
:style="{ 'object-position': thumbnailPosition }">
<img v-else-if='!media && thumb' class='thumb' src="noimg.svg" alt=''>
</div>
</div>
</template>
<script>
@@ -100,8 +94,4 @@ export default {
aspect-ratio: 1.7778;
}
.img img.loading {
opacity: 0.1;
}
</style>