StealThis .dev

Watermark

Canvas-based watermark overlay generator — text or image watermark, configurable opacity, angle, repeat pattern.

Open in Lab
canvas vanilla-js
Targets: JS HTML

Code

Watermark

A Canvas 2D-based watermark generator. Renders a tiling text (or image) watermark at a configurable angle and opacity over any container element. Controls let you tune the text, opacity, rotation, size, and spacing in real time.

How it works

A <canvas> element is absolutely positioned over the target container. The canvas draws repeated rotated text tiles across its full area. Every control change re-draws the canvas via requestAnimationFrame.

Features

  • Live preview with real-time canvas redraw
  • Configurable: text, opacity (0–100%), angle (0–90°), font size, spacing
  • Pure vanilla JS + Canvas 2D API
  • No external libraries
  • Export-ready: the canvas can be converted to a data URL via canvas.toDataURL()

Usage

Wrap your content in an element with class="wm-target" and call initWatermark(target, options). The watermark canvas is appended as a sibling and positioned over the target.