@bannerboy/fallback-canon

1.2.0 • Public • Published

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: 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 or jpg: just creates a static
  • 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 used 500 for a static and 40 for a fallback and if the fallback is bigger then 980x600 80 will be used and if its bigger then 1920x1080 150 will be used

Settings: Different settings that are not unit based, all optional:

  • defaultType: string, default 'jpeg' - Default fallback type for HTML fallbacks. Can be jpeg (with an e, not jpg), or png
  • destinationFallbacks: string, default 'fallbacks' - Folder name for HTML units fallbacks
  • destinationStatic: string, default 'statics' - Folder name to copy static images, if type is set to jpg or png
  • copyInBanner: boolean, default true - Also copy the fallback in the build folder.
  • showLogs: boolean, default false - Set to false to limit the logs output in the console
  • fastForwardScript: string, default gsap.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, default 3000 - Change server port if needed
  • defaultSize: Object - Default outpit fileSize for statics and fallbacks, as kb strings. default
{
  statics: '500kb',
  fallbacks: '40kb',
}

Readme

Keywords

none

Package Sidebar

Install

npm i @bannerboy/fallback-canon

Weekly Downloads

4

Version

1.2.0

License

ISC

Unpacked Size

12.4 kB

Total Files

4

Last publish

Collaborators

  • joakimkoch
  • rosengren.simon
  • fredriklindh
  • wistrand
  • alestry-perez
  • elsabynke
  • matildabjork
  • teixeir3
  • tommypreger
  • patrikjanson
  • simonabrams
  • turbofalcon
  • gimars
  • tomasz_nowicki
  • bbelliotsverin