mirror of
https://github.com/immich-app/immich.git
synced 2025-12-20 01:11:46 +03:00
14 lines
384 B
TypeScript
14 lines
384 B
TypeScript
|
|
/**
|
||
|
|
* Glossary
|
||
|
|
* 1. Section: Group of assets in a month
|
||
|
|
*/
|
||
|
|
|
||
|
|
export function calculateViewportHeightByNumberOfAsset(assetCount: number, viewportWidth: number) {
|
||
|
|
const thumbnailHeight = 235;
|
||
|
|
|
||
|
|
const unwrappedWidth = (3 / 2) * assetCount * thumbnailHeight * (7 / 10);
|
||
|
|
const rows = Math.ceil(unwrappedWidth / viewportWidth);
|
||
|
|
const height = rows * thumbnailHeight;
|
||
|
|
return height;
|
||
|
|
}
|