README.md

December 11, 2022 ยท View on GitHub

Watermark

Create watermark for webpage and automatic adjust when windows resize.

Kind: global class
Version: 1.0.4
Author: Lruihao

new Watermark(options)

Constructor of Watermark

ParamTypeDefaultDescription
optionsObject
[options.content]Stringwatermark's text
[options.appendTo]String'body'parent of watermark's container
[options.width]Number150watermark's width. unit: px
[options.height]Number20watermark's height. unit: px
[options.rowSpacing]Number60row spacing of watermarks. unit: px
[options.colSpacing]Number30col spacing of watermarks. unit: px
[options.rotate]Number15watermark's tangent angle. unit: deg
[options.opacity]Number0.1watermark's transparency
[options.fontSize]Number0.85watermark's fontSize. unit: rem
[options.fontFamily]Number'inherit'watermark's fontFamily.

watermark.upload(content)

Upload watermark's text content

Kind: instance method of Watermark
Since: 1.0.0

ParamTypeDescription
contentStringwatermark's text

watermark.render(options)

Rerender watermark

Kind: instance method of Watermark
Since: 1.0.0

ParamTypeDescription
optionsObjectsee Constructor

watermark.destroy()

Force destroy watermark

Kind: instance method of Watermark
Since: 1.0.0