Skip to content

LeeRayno/simple-watermark

Repository files navigation

simple-watermark

A simple watermark for CMS Web page

Installing

# install via npm
npm i simple-watermark -S

Usage

// ES6
import Watermark from 'simple-watermark'
// or commonjs
const Watermark = require('simple-watermark')
// or cdn
<script src="https://unpkg.com/[email protected]/dist/simple-watermark.js"></script>

const watermark = new Watermark({
  // options
})

// if you want to destory the instance of watermark
watermark.destory()

Options

// default options
const DEFAULT_OPTIONS = {
  el: document.body,
  position: 'fixed',
  zIndex: 2000,
  width: '200px',
  height: '150px',
  textAlign: 'center',
  textBaseline: 'middle',
  font: '20px microsoft yahei',
  fillStyle: 'rgba(184, 184, 184, .8)',
  fillText: 'watermark',
  rotate: 30
}

Demo

here

watermark

Releases

No releases published

Packages

No packages published