Description: Generate the `object-position` value to capture an image's focal point given a custom aspect-ratio. Created by Stephanie Eckles (@5t3ph).
Generate the object-position value to capture an image's focal point given a custom aspect-ratio.
The primary dependency is the sharp package resize API to help calculate the focal point using Shannon entropy . Dynamically generated results are possible thanks to Eleventy Serverless .
The examples using a ratio require browser support for aspect-ratio (available in all evergreen browsers once Safari 15 is released).