Browse Source

RING:水印透明度降低

ringcode 4 years ago
parent
commit
d6733bb19a
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/hooks/useWatermark.ts

+ 3 - 3
src/hooks/useWatermark.ts

@@ -14,7 +14,7 @@ const domSymbol = Symbol("watermark-dom");
 export function useWatermark(
   appendEl: Ref<HTMLElement | null> = ref(document.body)
 ) {
-  let func: Fn = () => {};
+  let func: Fn = () => { };
   const id = domSymbol.toString();
 
   //清除水印
@@ -38,7 +38,7 @@ export function useWatermark(
     if (cans) {
       cans.rotate((-20 * Math.PI) / 120);
       cans.font = "30px Vedana";
-      cans.fillStyle = "rgba(0, 0, 0, 0.15)";
+      cans.fillStyle = "rgba(0, 0, 0, 0.06)";
       cans.textAlign = "left";
       cans.textBaseline = "middle";
       cans.fillText(str, can.width / 20, can.height);
@@ -62,7 +62,7 @@ export function useWatermark(
     const MutationObserver =
       window.MutationObserver || window.WebKitMutationObserver;
     if (MutationObserver) {
-      let mo: any = new MutationObserver(function() {
+      let mo: any = new MutationObserver(function () {
         const __wm = document.getElementById(id);
         if (!__wm) {
           mo.disconnect();