1
0
forked from Cutlery/immich
immich-quadlet/web/src/lib/utils/viewport-utils.ts
Alex d856b35afc
feat(web) add scrollbar with timeline information (#658)
- Implement a scrollbar with a timeline similar to Google Photos
- The scrollbar can also be dragged
2022-09-09 15:55:20 -05:00

15 lines
441 B
TypeScript

/**
* Glossary
* 1. Section: Group of assets in a month
*/
export function calculateViewportHeightByNumberOfAsset(assetCount: number, viewportWidth: number) {
const thumbnailHeight = 237;
// const unwrappedWidth = (3 / 2) * assetCount * thumbnailHeight * (7 / 10);
const unwrappedWidth = assetCount * thumbnailHeight;
const rows = Math.ceil(unwrappedWidth / viewportWidth);
const height = rows * thumbnailHeight;
return height;
}