watermark-observer
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

watermark-observer

Build status Test coverage NPM version NPM Downloads Prettier Conventional Commits

Watermark effect with dom observer

Installation

npm install watermark-observer
# or use yarn
yarn add watermark-observer

Usage

import watermarkObserver, { watermarkObserverStandalone, createFixedWatermarkContainerDOM } from 'watermark-observer'

// 独立注入水印,检测到修改将会重新创建
watermarkObserverStandalone(createFixedWatermarkContainerDOM('water-mark-standlone'), require('./image.png').default)

// 注入水印至已有内容容器中,检测到修改将会重新设置样式
watermarkObserver(window.container, '/watermark')

Contributing

  • Fork it!
  • Create your new branch:
    git checkout -b feature-new or git checkout -b fix-which-bug
  • Start your magic work now
  • Make sure npm test passes
  • Commit your changes:
    git commit -am 'feat: some description (close #123)' or git commit -am 'fix: some description (fix #123)'
  • Push to the branch: git push
  • Submit a pull request :)

Authors

This library is written and maintained by 余聪, yucong06@meituan.com.

License

MIT - 余聪 🐟

Package Sidebar

Install

npm i watermark-observer

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

65.4 kB

Total Files

13

Last publish

Collaborators

  • moyuyc