Force 3/2 format for non landscape photos on Location page

Center image on a background when square, portrait or other ratio
- Fix MutuationObserver for using components (would think a component is an item)
This commit is contained in:
2022-06-13 18:28:24 +02:00
parent b649187365
commit 615f7df4a1
5 changed files with 58 additions and 22 deletions

View File

@@ -1,6 +1,19 @@
import type { RequestEvent, RequestHandlerOutput } from '@sveltejs/kit'
import { fetchAPI } from '$utils/api'
export const photoFields = `
title
slug
city
image {
id
title
}
orientation
date_taken
date_created
`
export async function get({ params }: RequestEvent): Promise<RequestHandlerOutput> {
try {
const { location } = params
@@ -40,15 +53,7 @@ export async function get({ params }: RequestEvent): Promise<RequestHandlerOutpu
limit: ${import.meta.env.VITE_LIST_AMOUNT},
page: 1,
) {
title
slug
city
image {
id
title
}
date_taken
date_created
${photoFields}
}
# Total