Tighten layout gaps, add grid density
This commit is contained in:
parent
f36e1def5f
commit
bec619e139
@ -19,7 +19,7 @@ export default async function HomePage({
|
||||
}: {
|
||||
searchParams: { next: string };
|
||||
}) {
|
||||
const { offset, limit } = getPhotosLimitForQuery(searchParams.next);
|
||||
const { offset, limit } = getPhotosLimitForQuery(searchParams.next, 12);
|
||||
|
||||
const photos = await getPhotos(undefined, limit);
|
||||
|
||||
@ -31,7 +31,7 @@ export default async function HomePage({
|
||||
photos.length > 0
|
||||
? <div className="space-y-4">
|
||||
<AnimateItems
|
||||
className="space-y-2"
|
||||
className="space-y-1"
|
||||
duration={0.7}
|
||||
staggerDelay={0.15}
|
||||
distanceOffset={0}
|
||||
|
||||
@ -29,8 +29,8 @@ export default function PhotoGrid({
|
||||
<>
|
||||
<AnimateItems
|
||||
className={cc(
|
||||
'grid gap-1 sm:gap-2',
|
||||
'grid-cols-2 sm:grid-cols-4 md:grid-cols-3',
|
||||
'grid gap-1',
|
||||
'grid-cols-2 sm:grid-cols-4 md:grid-cols-3 lg:grid-cols-4',
|
||||
'items-center',
|
||||
)}
|
||||
duration={fast ? 0.3 : undefined}
|
||||
|
||||
@ -14,8 +14,6 @@ import camelcaseKeys from 'camelcase-keys';
|
||||
import { Metadata } from 'next';
|
||||
import short from 'short-uuid';
|
||||
|
||||
export const PHOTOS_PER_REQUEST = 12;
|
||||
|
||||
const translator = short();
|
||||
|
||||
// Core EXIF data
|
||||
@ -124,7 +122,7 @@ export const getNextPhoto = (photo: Photo, photos: Photo[]) => {
|
||||
|
||||
export const getPhotosLimitForQuery = (
|
||||
query?: string,
|
||||
photosPerRequest = PHOTOS_PER_REQUEST,
|
||||
photosPerRequest = 24,
|
||||
) => {
|
||||
const offsetInt = parseInt(query ?? '0');
|
||||
const offset = (Number.isNaN(offsetInt) ? 0 : offsetInt);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user