forked from vyla-entertainment/home-frontend
enhanced lighthouse report
This commit is contained in:
@@ -4,9 +4,22 @@ import { observeReveals } from '../animations/reveal-observer.js';
|
||||
|
||||
function createPartnerItem(partner) {
|
||||
const item = createElement('div', 'partner-item reveal');
|
||||
let imgHTML;
|
||||
|
||||
if (partner.logo) {
|
||||
if (partner.logoSmall) {
|
||||
imgHTML = `<img src="${partner.logoSmall}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async"
|
||||
srcset="${partner.logoSmall} 64w, ${partner.logo} 128w" sizes="64px">`;
|
||||
} else {
|
||||
imgHTML = `<img src="${partner.logo}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async">`;
|
||||
}
|
||||
} else {
|
||||
imgHTML = '';
|
||||
}
|
||||
|
||||
const inner = partner.link
|
||||
? `<a href="${partner.link}" target="_blank" rel="noopener noreferrer"><img src="${partner.logo}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async"></a>`
|
||||
: `<img src="${partner.logo}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async">`;
|
||||
? `<a href="${partner.link}" target="_blank" rel="noopener noreferrer">${imgHTML}</a>`
|
||||
: imgHTML;
|
||||
item.innerHTML = inner;
|
||||
return item;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user