1.0.11 • Published 3 months ago

@tanzhen08/watermark v1.0.11

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
3 months ago

Read this in other languages: English, 中文.

Watermark Class

This is a TypeScript class for creating a watermark on a web page. 🎈Features/support items:

  • ⚠️Anti-deletion: Prevent users from deleting the watermark through the console. Even if deleted, it can be restored immediately.

  • 👀Anti-hiding: Prevent users from hiding the watermark through the console. Even if hidden, it can be restored immediately.

  • 🗽Configuration: Supports configuration of the watermark's text, size, color, transparency, rotation angle, spacing, etc.

Configuration

The Watermark class can be configured with the following properties:

  • text: The text to be displayed as the watermark.
  • fontSize: The size of the text.
  • rgb: The color of the text in RGB format.
  • opacity: The opacity of the text.
  • rotate: The rotation angle of the text.
  • gapX: The horizontal spacing between the text.
  • gapY: The vertical spacing between the text.

Usage

To use the Watermark class, you need to create an instance of it and call the start method. Here is an example:

import { Watermark } from '@tanzhen08/watermark';

const watermark = new Watermark(document.body, {
    text: 'watermark',
    fontSize: 16,
    rgb: [0, 0, 0],
    opacity: 0.15,
    rotate: -30,
    gapX: 200,
    gapY: 200,
});

watermark.start();

This will create a watermark on the entire body of the web page with the specified configuration.

License

This project is licensed under the MIT License.

1.0.11

3 months ago

1.0.10

3 months ago

1.0.9

3 months ago

1.0.8

3 months ago

1.0.7

3 months ago

1.0.6

3 months ago

1.0.5

3 months ago

1.0.4

3 months ago

1.0.3

3 months ago

1.0.2

3 months ago

1.0.1

3 months ago

1.0.0

3 months ago