Aspect ratio and fetch priority fix
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/deploy Pipeline was successful

This commit is contained in:
2026-02-14 20:24:26 -03:00
parent 28401d5027
commit e712e73902
2 changed files with 5 additions and 3 deletions

View File

@@ -72,12 +72,14 @@ body {
}
.gallery-item {
aspect-ratio: 3/2;
margin: 0 0 1rem;
position: relative;
cursor: pointer;
}
.gallery-item img {
height: auto;
width: 100%;
display: block;
border-radius: 8px;

View File

@@ -64,10 +64,10 @@ const createPicture = (item) => {
const img = document.createElement('img');
img.src = `assets/media/thumbnail/${item.name}.webp`;
img.alt = item.alt.replace(/[]/g, '');
img.height = item.height || 300;
img.width = item.width || 300;
img.height = item.height || undefined;
img.width = item.width || undefined;
img.loading = item.loading || 'lazy';
img.fetchpriority = item.fetchpriority || undefined;
img.fetchPriority = item.fetchpriority || undefined;
pic.appendChild(img);
return pic;
};