perf: optimize homepage and logo images to webp
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user