viewport-utils.ts 384 B

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