perf: optimize homepage and logo images to webp

This commit is contained in:
2026-07-26 10:18:43 +02:00
parent fabc63edf5
commit 789a200595
50 changed files with 126 additions and 29 deletions
@@ -16,7 +16,7 @@ describe('PhotoBand', () => {
// The CSS animation translates the track by -50%. If the sequence is not
// rendered exactly twice, the loop "jumps" instead of being seamless.
it('renders the image sequence exactly twice for a seamless loop', () => {
const images = ['/a.jpg', '/b.jpg', '/c.jpg']
const images = ['/a.webp', '/b.webp', '/c.webp']
const { container } = render(<PhotoBand images={images} />)
const rendered = [...container.querySelectorAll('.photo-band-track img')].map(img =>
img.getAttribute('src')
@@ -30,7 +30,7 @@ describe('PhotoBand', () => {
it('keeps the duplication invariant for any non-empty image list', () => {
for (const n of [1, 2, 4, 7]) {
const images = Array.from({ length: n }, (_, i) => `/img-${i}.jpg`)
const images = Array.from({ length: n }, (_, i) => `/img-${i}.webp`)
const { container } = render(<PhotoBand images={images} />)
const count = container.querySelectorAll('.photo-band-track img').length
expect(count).toBe(n * 2)