代码拉取完成,页面将自动刷新
Clone source
git clone git@github.com:Lruihao/watermark.git
Load Watermark
<script type="text/javascript" src="./src/watermark.js"></script>
<script type="text/javascript" src="./src/watermark.min.js"></script>
<!-- Or CDN -->
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cell-watermark@1.0.3/src/watermark.js"></script>
<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/cell-watermark@1.0.3/src/watermark.min.js"></script>
Initialization
document.addEventListener('DOMContentLoaded', function () {
new Watermark({
content: "cell-watermark"
})
});
Install
npm i cell-watermark
Import
import Watermark from 'cell-watermark'
/* Or */
var Watermark = require("cell-watermark")
Name | Type | Description |
---|---|---|
options | Object | The options of watermark(Properties) |
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
content | String | <optional> | watermark's text | |
appendTo | String | <optional> | 'body' | parent of watermark's container |
width | Number | <optional> | 150 | watermark's width. unit: px |
height | Number | <optional> | 20 | watermark's height. unit: px |
rowSpacing | Number | <optional> | 60 | row spacing of watermarks. unit: px |
colSpacing | Number | <optional> | 30 | col spacing of watermarks. unit: px |
rotate | Number | <optional> | 15 | watermark's tangent angle. unit: deg |
opacity | Number | <optional> | 0.1 | watermark's transparency |
fontSize | Number | <optional> | 0.85 | watermark's fontSize. unit: rem |
fontFamily | String | <optional> | 'inherit' | watermark's fontFamily |
Author: Lruihao
Upload watermark's text content
Name | Type | Description |
---|---|---|
content | String | watermark's text |
Rerender watermark
Name | Type | Description |
---|---|---|
options | Object | The options of watermark(Properties) |
Force destroy watermark
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。