mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-05 11:05:53 +00:00
This PR implemented a virtual scroll on the web, as seen in this article. [Building the Google Photos Web UI](https://medium.com/google-design/google-photos-45b714dfbed1)
13 lines
384 B
TypeScript
13 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;
|
|
}
|