fenzhi-utils
Version:
分值前端项目的js函数库
67 lines (63 loc) • 2.61 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>测试某个函数</title>
<script src="./dist/Fenzhi.umd.js"></script>
<script src="https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.21/lodash.min.js"></script>
<style>
#boxue {
background-color: #13233b;
opacity: 0.01;
width: 100%;
height: 60px;
}
</style>
</head>
<body>
<div id="boxue"></div>
<button onclick="closeFn()">关闭</button>
<button onclick="startFn()">开启</button>
<script>
// console.log(Fenzhi.CustomTendToWan()); // ''
// console.log(Fenzhi.CustomTendToWan(113456789)); // '1.13'
// console.log(Fenzhi.CustomTendToWan(-110000000)); // '-1.10'
// console.log(Fenzhi.CustomTendToWan(11000)); // '1.10'
// console.log(Fenzhi.CustomTendToWan(-11000)); // '-1.10'
// console.log(Fenzhi.CustomTendToWan(11)); // '11'
let watermark = new Fenzhi.CustomWatermark({
waterText: '郭坤', // 水印文字
waterTextColor: '#f00', // 水印文字颜色
waterTextFontSize: 20, // number,水印文字大小
waterElID: 'CustomWater-' + '1.23452384164.123412415', // 水印挂载的id,【需以CustomWater-开头】
waterAreaPosition: 'fixed',
waterAreazIndex: '9999999',
waterAreaRotate: (-20 * Math.PI) / 150, // 水印的旋转角度
singleWidth: 200, // 需大于文字的宽度
singleHeight: 200, // 需大于文字所需要的高度
positionTop: '100px',
positionleft: '200px',
});
function closeFn() {
watermark.destroyed();
}
function startFn() {
watermark = new Fenzhi.CustomWatermark({
waterText: '郭坤', // 水印文字
waterTextColor: '#f00', // 水印文字颜色
waterTextFontSize: 20, // number,水印文字大小
waterElID: 'CustomWater-' + '1.23452384164.123412415', // 水印挂载的id,【需以CustomWater-开头】
waterAreaPosition: 'fixed',
waterAreazIndex: '9999999',
waterAreaRotate: (-20 * Math.PI) / 150, // 水印的旋转角度
singleWidth: 200, // 需大于文字的宽度
singleHeight: 200, // 需大于文字所需要的高度
positionTop: '100px',
positionleft: '200px',
});
}
</script>
</body>
</html>