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: 300x600 -
type
: defines the output type-
empty or
html
: will generate a fallback in the fallback folder, and at the source of the banner itself -
png
orjpg
: just creates a static
-
empty or
-
staticImageQuality
: optional - The quality of the image, between 0-100. Not applicable to png images -
fallbackWeight
: optional - The maximum file size of the generated image, as a kilobyte number. Example:150
for a static (png or jpg). If its not given the default values will be used500
for a static and40
for a fallback and if the fallback is bigger then 980x60080
will be used and if its bigger then 1920x1080150
will 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), orpng
-
destinationFallbacks
: string, default'fallbacks'
- Folder name for HTML units fallbacks -
destinationStatic
: string, default'statics'
- Folder name to copy static images, if type is set tojpg
orpng
-
copyInBanner
: boolean, defaulttrue
- Also copy the fallback in the build folder. -
showLogs
: boolean, defaultfalse
- Set tofalse
to limit the logs output in the console -
fastForwardScript
: 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 screenshots -
port
: number, default3000
- Change server port if needed -
defaultSize
: Object - Default outpit fileSize for statics and fallbacks, as kb strings. default
{
statics: '500kb',
fallbacks: '40kb',
}