pig.js
pig.js copied to clipboard
Add support for custom ProgressiveImage equivalents
As it is, pig.js doesn't give you any control over what is rendered on the grid, beyond specifying a filename and aspect ratio for each image. This adds the ability to specify an alternative implementation of ProgressiveImage to display images with.
Implementations must still provide the same interface as ProgressiveImage, which according to what Pig uses is (in TypeScript):
interface PigImage {
aspectRatio: number;
style: PigImageStyle;
load(): void;
hide(): void;
}
// All numbers have units pixels.
interface PigImageStyle {
width: number;
height: number;
translateX: number;
translateY: number;
transition: string;
}