You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
927 B

const c=()=>{const d=n=>{const t="1.23452384164.123412415";document.getElementById(t)!==null&&document.body.removeChild(document.getElementById(t));const l=document.createElement("canvas");l.width=n.length*15,l.height=250;const o=l.getContext("2d");o.rotate(-20*Math.PI/100),o.font="18px Vedana",o.fillStyle="rgba(200, 200, 200, 0.40)",o.textAlign="left",o.fillText(n,-l.width/3,l.height/2);const e=document.createElement("div");return e.id=t,e.style.pointerEvents="none",e.style.top="64px",e.style.left="0px",e.style.position="fixed",e.style.zIndex="100000",e.style.width=document.documentElement.clientWidth+"px",e.style.height=document.documentElement.clientHeight+"px",e.style.background="url("+l.toDataURL("image/png")+") left top repeat",document.body.appendChild(e),t};return{watermark:n=>{let t=d(n);setInterval(()=>{document.getElementById(t)===null&&(t=d(n))},500),window.onresize=()=>{d(n)}}}};export{c as getmark};