mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore(web): curly braces (#5362)
This commit is contained in:
parent
5c1c174db1
commit
4d727708e2
3 changed files with 26 additions and 8 deletions
|
|
@ -7,12 +7,26 @@
|
|||
export function getThumbnailSize(assetCount: number, viewWidth: number): number {
|
||||
if (assetCount < 6) {
|
||||
return Math.min(320, Math.floor(viewWidth / assetCount - assetCount));
|
||||
} else {
|
||||
if (viewWidth > 600) return viewWidth / 7 - 7;
|
||||
else if (viewWidth > 400) return viewWidth / 4 - 6;
|
||||
else if (viewWidth > 300) return viewWidth / 2 - 6;
|
||||
else if (viewWidth > 200) return viewWidth / 2 - 6;
|
||||
else if (viewWidth > 100) return viewWidth / 1 - 6;
|
||||
}
|
||||
|
||||
if (viewWidth > 600) {
|
||||
return viewWidth / 7 - 7;
|
||||
}
|
||||
|
||||
if (viewWidth > 400) {
|
||||
return viewWidth / 4 - 6;
|
||||
}
|
||||
|
||||
if (viewWidth > 300) {
|
||||
return viewWidth / 2 - 6;
|
||||
}
|
||||
|
||||
if (viewWidth > 200) {
|
||||
return viewWidth / 2 - 6;
|
||||
}
|
||||
|
||||
if (viewWidth > 100) {
|
||||
return viewWidth / 1 - 6;
|
||||
}
|
||||
|
||||
return 300;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue