mirror of
https://github.com/immich-app/immich
synced 2025-11-14 17:36:12 +00:00
Feature - Implemented virtual scroll on web (#573)
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)
This commit is contained in:
parent
bd92dde117
commit
552340add7
58 changed files with 2197 additions and 698 deletions
13
web/src/lib/utils/viewport-utils.ts
Normal file
13
web/src/lib/utils/viewport-utils.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
/**
|
||||
* 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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue