wangyewei / aquamark

Aquamark.js is a watermark util based on canvas & typescript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool


Aquamark.js

A light-weight, strong, safe and responsive watermark tool for webpage.
Based on Canvas & Typescript

GitHub License GitHub Actions Workflow Status

npm package minimized gzipped size NPM Unpacked Size

Light weight: 1.14kb minified size ; Safe: Manual removal of watermarks is not allowed; Responsive: Adaptive screen size; Strong: Almost 100% test coverage

Installation

Install using CDN

<script src="https://unpkg.com/browse/aquamark/dist/index.iife.js"></script>

Install using npm

$ npm install aquamark

Basic Usage

In Browser

<script src="https://unpkg.com/browse/aquamark/dist/index.iife.js"></script>
<script>
  const aquamark = new Aquamark(/** props */)
  aquamark.init()
</script>

In webpack or vite etc;

import Aquamark from "aquamark"
const aquamark = new Aquamark(/** props */)
aquamark.init()

Props

name type description required default
content string watermark content false 'auqamark.js'
rotate number( -180~180) content rotate false -22
font AuqamarkFont font-related false
top number false 0
left number false 0
zIndex number z-index false 0

AquamarkFont

name type description required default
color string font color false rgba(0, 0, 0, .15)
fontSize number text size false 22
fontWeight 'normal', 'light', 'weight', number text weight false 'normal'
fontFamily string text font-famlily false 'normal'
textAlign 'start', 'end', 'left', 'right', 'center' text align false 'center'

Methods

name description parameters
init watermark initial -

License

Aquamark licensed on MIT LICENSE. ©2024-present Yev Wang

About

Aquamark.js is a watermark util based on canvas & typescript

License:MIT License


Languages

Language:TypeScript 81.1%Language:HTML 11.0%Language:JavaScript 7.9%