mirror of
https://github.com/friendica/friendica
synced 2025-05-09 01:04:13 +02:00
Merge pull request #13463 from MrPetovan/task/imagegrid-improvement
Rework image grid to horizontal masonry, allocate space for images to load
This commit is contained in:
commit
dd7bea4bd1
11 changed files with 149 additions and 48 deletions
|
@ -1169,4 +1169,15 @@ class Media
|
|||
}
|
||||
return $url . $id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Computes the allocated height value used in the content/image.tpl template based on a post-media record
|
||||
*
|
||||
* @param array $media A post-media record array
|
||||
* @return string
|
||||
*/
|
||||
public static function getAllocatedHeightByMedia(array $media): string
|
||||
{
|
||||
return (100 * $media['height'] / $media['width']) . '%';
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue