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

maple-watermark

v1.1.3

Published

add watermark

Downloads

9

Readme

Methods

  • {addWatermark} Function 添加水印

Usage

  • {config} Object
import { addWatermark } from "maple-watermark";

const config = {
	// 默认配置
	$el: document.body, // 挂载的父元素,建议父元素设置position
	firstStr: "Maple", // 第一段文字
	secondStr: "1208", // 第二段文字, 传入空字符串可以隐藏
	font: "14px Vedana", // 字体,参考css语法font
	color: "#bfbfbf", // 字体颜色,参考css语法color
	textAlign: "left", // 文本对齐方式,参考css语法canvas textAlign
	textBaseline: "Middle", // 文本基线,参考css语法canvas textBaseline
	rotate: (-20 * Math.PI) / 180, // 内容旋转角度,参考css语法canvas rotate
	firstStrLocal: {
		x: 15,
		y: 40
	}, // 第一段文字坐标
	secondStrLocal: {
		x: 15,
		y: 56
	}, // 第二段文字坐标
	top: 0, // 内容top,参考css语法position top
	left: 0, // 内容left,参考css语法position left
	zIndex: 1208120812081208, // 内容层级,参考css语法position z-index
	opacity: 0.28, // 字体颜色深浅,参考css语法opacity
	width: "100%", // 内容宽度,参考css语法width
	height: "100%", // 内容高度,参考css语法height
	canvasHeight: 128, // 画布高度,参考css语法height
	canvasWidth: 128, // 画布宽度,参考css语法width
	type: "canvas", // 水印类型:canvas | picture
	bgUrl: "", // 自定义水印图片
	bgRepeat: "repeat", // 是否及如何重复背景图像,参考css语法background-repeat
	bgSize: "auto", // 背景图像的尺寸,参考css语法background-size
	bgPosition: "top left", // 背景图像的起始位置,参考css语法background-position
	bgAttachment: "scroll" // 设置固定的背景图像,参考css语法background-attachment
};

addWatermark(config);

Source address

github:https://github.com/hf0913/watermark npm:https://www.npmjs.com/package/maple-watermark

Contact information

QQ:1330713179 WeChat:HF15243886475 Email:[email protected]