Files
aurora-admin/frameworks/Watermark.html
T

29 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Aurora Admin · Watermark(普通 H5)</title>
<link rel="stylesheet" href="../.design_library/aurora-admin/colors_and_type.css" />
<link rel="stylesheet" href="Watermark.css" />
<style>body{margin:0;padding:24px;background:#F5F7FA;} .aa-box{position:relative;height:240px;background:#fff;border:1px solid #E8ECF1;border-radius:8px;padding:20px;overflow:hidden;}</style>
</head>
<body>
<div class="aa-box">
<div class="aa-watermark" id="wm"></div>
<h3 style="position:relative;color:#1F2329">机密文档</h3>
<p style="position:relative;color:#595959">该区域内容受水印保护,请勿外传。</p>
</div>
<script>
function buildWatermark(text, color, fontSize, rotate, gap) {
var svg = "<svg xmlns='http://www.w3.org/2000/svg' width='" + gap + "' height='" + gap + "'>" +
"<text x='0' y='" + (fontSize + 6) + "' font-family='sans-serif' font-size='" + fontSize +
"' fill='" + color + "' transform='rotate(" + rotate + " 0 " + (fontSize + 6) + ")'> " + text + " </text></svg>";
return "url(\"data:image/svg+xml;utf8," + encodeURIComponent(svg) + "\")";
}
document.getElementById('wm').style.backgroundImage = buildWatermark('Aurora Admin', 'rgba(0,0,0,0.10)', 14, -22, 160);
</script>
</body>
</html>