Skip to content

JS API

The FigureTwicpics class extends the Figure class and adds support for TwicPics API.

Options

domain

  • Type: string
  • Default: ''

Use this option to configure your Twicpics domain.

path

  • Type: string
  • Default: ''

Use this option to configure your Twicpics path.

transform

  • Type: string
  • Default: ''

Use this option to add transforms to the image with TwicPics URL API.

step

  • Type: number
  • Default: 50

The step used to round up image size calculation. Default to 50, which means that a size of 320×380 will be rounded to 350×400.

mode

  • Type: string
  • Default: 'cover'

The mode used to resize and crop the image. It can be any key of the transformations API of TwicPics which accepts a size as value.

dpr

  • Type: boolean
  • Default: true

Use this option to disable the support of the Device Pixel Ratio (DPR) with data-option-no-dpr attribute.

disable

  • Type: boolean
  • Default: false

Use this option to return the original src instead of the TwicPics src. Useful when testing in local or preproductions that does not have a TwicPics path configured.

Getter

domain

  • Return: string

A getter to override in a child class in order to define the main host on which the image should be served by Twicpics. It will be used to replace the host of the image source.

path

  • Return: string

A getter to override in a child class in order to define the path on which the image should be server by Twicpics. It will be used to prefix the pathname of the image source.