|
|
@ -15,14 +15,14 @@ export function useWatermark(appendEl: HTMLElement | null = document.body) { |
|
|
|
clear() |
|
|
|
clear() |
|
|
|
|
|
|
|
|
|
|
|
const can = document.createElement('canvas') |
|
|
|
const can = document.createElement('canvas') |
|
|
|
can.width = 300 |
|
|
|
can.width = 500 |
|
|
|
can.height = 240 |
|
|
|
can.height = 240 |
|
|
|
|
|
|
|
|
|
|
|
const cans = can.getContext('2d') |
|
|
|
const cans = can.getContext('2d') |
|
|
|
if (cans) { |
|
|
|
if (cans) { |
|
|
|
cans.rotate((-20 * Math.PI) / 120) |
|
|
|
cans.rotate((-20 * Math.PI) / 120) |
|
|
|
cans.font = '15px Vedana' |
|
|
|
cans.font = '15px Vedana' |
|
|
|
cans.fillStyle = 'rgba(0, 0, 0, 0.15)' |
|
|
|
cans.fillStyle = 'rgba(0, 0, 0, 0.05)' |
|
|
|
cans.textAlign = 'left' |
|
|
|
cans.textAlign = 'left' |
|
|
|
cans.textBaseline = 'middle' |
|
|
|
cans.textBaseline = 'middle' |
|
|
|
cans.fillText(str, can.width / 20, can.height) |
|
|
|
cans.fillText(str, can.width / 20, can.height) |
|
|
|