@bannerboy/fallback-canon
v1.2.0
Published
Generate fallback for HTML banners
Maintainers
Keywords
Readme
Fallback Canon
Requires Google Chrome installed on Mac or Windows at their default location.
Generate fallback for bb3k
Parameters:
Units: Takes a list of units. Usually created from bb3k. units is an array of units. Each unit can have the following properties:
dimensions: will set the fallback dimensions. ex: 300x600type: defines the output type- empty or
html: will generate a fallback in the fallback folder, and at the source of the banner itself pngorjpg: just creates a static
- empty or
staticImageQuality: optional - The quality of the image, between 0-100. Not applicable to png imagesfallbackWeight: optional - The maximum file size of the generated image, as a kilobyte number. Example:150for a static (png or jpg). If its not given the default values will be used500for a static and40for a fallback and if the fallback is bigger then 980x60080will be used and if its bigger then 1920x1080150will be used
Settings: Different settings that are not unit based, all optional:
defaultType: string, default'jpeg'- Default fallback type for HTML fallbacks. Can bejpeg(with an e, not jpg), orpngdestinationFallbacks: string, default'fallbacks'- Folder name for HTML units fallbacksdestinationStatic: string, default'statics'- Folder name to copy static images, if type is set tojpgorpngcopyInBanner: boolean, defaulttrue- Also copy the fallback in the build folder.showLogs: boolean, defaultfalse- Set tofalseto limit the logs output in the consolefastForwardScript: string, defaultgsap.globalTimeline.timeScale(10) // gsap.set('#cover', {visibility: 'hidden'}) // gsap.set('#banner', {opacity: 1}) // gsap.globalTimeline.seek(gsap.globalTimeline.duration())- Add any Javascript to apply to your banners before taking screenshotsport: number, default3000- Change server port if neededdefaultSize: Object - Default outpit fileSize for statics and fallbacks, as kb strings. default
{
statics: '500kb',
fallbacks: '40kb',
}