updated UI

This commit is contained in:
2026-09-10 20:15:03 -07:00
parent 806b32e30e
commit a323019d32
17 changed files with 305 additions and 98 deletions

View File

@@ -1,17 +1,20 @@
import { getPartners } from '../services/partners-service.js';
import { createElement } from '../utils/dom.js';
import { observeReveals } from '../animations/reveal-observer.js';
import { shouldReduceEffects } from '../utils/device-capability.js';
function createPartnerItem(partner) {
const item = createElement('div', 'partner-item reveal');
const item = createElement('div', 'partner-item');
let imgHTML;
if (partner.logo) {
if (partner.logoSmall) {
imgHTML = `<img src="${partner.logoSmall}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async"
fetchpriority="low"
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">`;
imgHTML = `<img src="${partner.logo}" alt="${partner.name}" width="128" height="128" loading="lazy" decoding="async"
fetchpriority="low">`;
}
} else {
imgHTML = '';
@@ -32,7 +35,12 @@ export async function initPartnersSection() {
const partners = await getPartners();
grid.innerHTML = '';
partners.forEach((partner) => grid.appendChild(createPartnerItem(partner)));
observeReveals(grid);
if (shouldReduceEffects()) {
grid.classList.add('in-view');
} else {
observeReveals(grid);
}
} catch (error) {
grid.innerHTML = '';
}