:mask: alimask 是一个使用 canvas 生成类似阿里巴巴内部网站水印图片的 JavaScript 库。
alimask 是一个使用 canvas 生成类似阿里巴巴内部网站水印图片的 JavaScript 库。Online demo here.
npm install alimask
Then import it.
<script type="text/javascript" src="dist/alimask.min.js"></script>
// or
var alimask = require('alimask');
// or
import alimask from 'alimask';
Then use alimask(text, options) API.
alimask('王小为(小为) 888888');
alimask('王小为(小为) 888888', { color: '#f6dcd7' });
alimask('小泥巴(小美) 888888', { alpha: 0.5 });
The unique API is: alimask(text, options).
250
.80
.#ebebeb
.0.8
.10px Arial
.The api return the base64 string of watermark image which can be used in css background / img tag.
npm install
npm run build
npm test
MIT @hustcc