Files
aurora-admin/frameworks/Watermark.jsx
T

15 lines
676 B
React

import React from 'react';
import './Watermark.css';
export default function Watermark({
text = 'Aurora Admin', color = 'rgba(0,0,0,0.10)', fontSize = 14,
rotate = -22, gap = 160, fullscreen = false
}) {
const 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>`;
const bg = `url("data:image/svg+xml;utf8,${encodeURIComponent(svg)}")`;
return (
<div className={'aa-watermark' + (fullscreen ? ' is-fullscreen' : '')} style={{ backgroundImage: bg }} />
);
}