npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

filigrana

v0.0.5

Published

watermark for frontend, pure function tool, suitable for any framework and vanilla

Downloads

34

Readme

filigrana

it is a Spanish word that refers to watermark in English

easy to use watermark for frontend. it's a pure function tool, suitable for any framework and vanilla.

Usage

signature is here

id:[string] watermark container id, default is 'water-mark-id', recommended to fill in a unique id
text:[string] watermark text, default is 'watermark'
fontColor:[string] text watermark color, default is '#ebebeb'
fontSize:[string] text watermark font size, default is 16px
image:[string] image watermark(higher priority than text)
scale:[number] image scaling ratio
angle:[number] watermark rotation angle
gapX:[number] horizontal spacing of watermark default is 4
gapY:[number] vertical spacing of watermark, default is 10
sparseness:[string] watermark sparseness: normal: regular sparse: sparse compressed: compact, default is normal
antiErase:[boolean] whether to enable anti-erase, enabled by default

text watermark

// watermarkFn is the easiest way to add watermark
import { watermarkFn } from 'filigrana';
const container = document.getElementById('container');
// first init
const watermark = watermarkFn({
  text: '水印123',
  id: 'water-mark-1',
  angle: 20,
});

// create canvas and mount it to a container, then use render() to render content,
// it will render text or image automatically
watermark.create(container).render();

image watermark

// render image mask is easy too;
import { watermarkFn } from 'filigrana';
const container = document.getElementById('container');
const watermark = watermarkFn({
  id: 'water-mark-img',
  image: 'your image url',
  angle: 20,
  scale: 0.25,
  sparseness: 'compressed',
});

watermark.create(container).render();

fullscreen watermark

import { watermarkFn } from 'filigrana';
const watermark = watermarkFn({
  id: 'water-mark-fullscreen',
  text: '😝',
  fontSize: 24,
  angle: -30,
});

// empty param of create() will render fullscreen watermark
watermark.create().render();