0.0.1 • Published 6 years ago

@fisher-zh/watermark v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

watermark

水印生成工具

安装

  • npm
npm install @fisher-zh/watermark
  • script
<script src="./dist/watermark.min.js"></script>

使用

WaterMark({
    type = 'canvas',
    container: document.getElementById('canvas'),
    content = 'WaterMark',
    width = '300px',
    height = '200px',
    rotate = '30',
    fontSize = '20px',
    color = 'rgba(184, 184, 184, 0.8)'
});
参数说明类型可选值默认值
type渲染方式stringcanvas/svgcanvas
container挂载的DOMobject-document.body
content水印内容string-WaterMark
width单个水印块的宽度string-300px
height单个水印块的高度string-200px
rotate水印文字的旋转角度string/number-30
fontSize水印文字的大小string-20px
color水印文字的颜色,string-20px
0.0.1

6 years ago