Speed up grid animations

This commit is contained in:
Sam Becker 2025-07-01 09:36:04 -05:00
parent 429fab8582
commit acb3926381
2 changed files with 6 additions and 11 deletions

View File

@ -15,7 +15,6 @@ export default function PhotoGrid({
photos, photos,
selectedPhoto, selectedPhoto,
photoPriority, photoPriority,
fast,
animate = true, animate = true,
canStart, canStart,
animateOnFirstLoadOnly, animateOnFirstLoadOnly,
@ -30,7 +29,6 @@ export default function PhotoGrid({
photos: Photo[] photos: Photo[]
selectedPhoto?: Photo selectedPhoto?: Photo
photoPriority?: boolean photoPriority?: boolean
fast?: boolean
animate?: boolean animate?: boolean
canStart?: boolean canStart?: boolean
animateOnFirstLoadOnly?: boolean animateOnFirstLoadOnly?: boolean
@ -62,8 +60,8 @@ export default function PhotoGrid({
)} )}
type={animate === false ? 'none' : undefined} type={animate === false ? 'none' : undefined}
canStart={canStart} canStart={canStart}
duration={fast ? 0.3 : undefined} duration={0.8}
staggerDelay={0.075} staggerDelay={0.04}
distanceOffset={40} distanceOffset={40}
animateOnFirstLoadOnly={animateOnFirstLoadOnly} animateOnFirstLoadOnly={animateOnFirstLoadOnly}
staggerOnFirstLoadOnly={staggerOnFirstLoadOnly} staggerOnFirstLoadOnly={staggerOnFirstLoadOnly}

View File

@ -2,7 +2,6 @@ import { formatFocalLength } from '@/focal';
import { getNextImageUrlForRequest } from '@/platforms/next-image'; import { getNextImageUrlForRequest } from '@/platforms/next-image';
import { photoHasFilmData } from '@/film'; import { photoHasFilmData } from '@/film';
import { import {
HIGH_DENSITY_GRID,
IS_PREVIEW, IS_PREVIEW,
SHOW_EXIF_DATA, SHOW_EXIF_DATA,
SHOW_FILMS, SHOW_FILMS,
@ -33,12 +32,10 @@ export const INFINITE_SCROLL_FEED_MULTIPLE =
process.env.NODE_ENV === 'development' ? 2 : 24; process.env.NODE_ENV === 'development' ? 2 : 24;
// INFINITE SCROLL: GRID // INFINITE SCROLL: GRID
export const INFINITE_SCROLL_GRID_INITIAL = HIGH_DENSITY_GRID export const INFINITE_SCROLL_GRID_INITIAL =
? process.env.NODE_ENV === 'development' ? 12 : 48 process.env.NODE_ENV === 'development' ? 12 : 48;
: process.env.NODE_ENV === 'development' ? 12 : 48; export const INFINITE_SCROLL_GRID_MULTIPLE =
export const INFINITE_SCROLL_GRID_MULTIPLE = HIGH_DENSITY_GRID process.env.NODE_ENV === 'development' ? 12 : 48;
? process.env.NODE_ENV === 'development' ? 12 : 48
: process.env.NODE_ENV === 'development' ? 12 : 48;
// Thumbnails below large photos on pages like /p/[photoId] // Thumbnails below large photos on pages like /p/[photoId]
export const RELATED_GRID_PHOTOS_TO_SHOW = 12; export const RELATED_GRID_PHOTOS_TO_SHOW = 12;