Scales images to be visually proportionate based on aspect ratio. An implementation of https://danpaquette.net/read/automatically-resizing-a-list-of-icons-or-logos-so-theyre-visually-proportional/
- @param {string} selector - An element selector for a set of elements to normalise
- @param {int} widthBase - The width a square image would be scaled to
- @param {int} scaleFactor - A balancing factor between scaling for height and width (i.e. aspect ratio bias). The default is generally visually balanced.
- @param {Element} parentEl - A parent element to search for the selector. Defaults to document.
import { ProportionalImageNormalisation } from "@keodesign/proportional-image-normalisation";
proportionalImageNormalisation(".banners-home .banner-inner-image", 40, 0.525, document.querySelector("header"));