pansyjs / Watermark
Licence: mit
watermark component
Stars: ✭ 47
Programming Languages
typescript
32286 projects
Projects that are alternatives of or similar to Watermark
React Sider
Lightweight Ant Design Pro like <Sider /> component integrated with Ant Design Menu.
Stars: ✭ 42 (-10.64%)
Mutual labels: component
Vue Glitch
👻 Vue.js component to apply glitch effect in any kind of text
Stars: ✭ 44 (-6.38%)
Mutual labels: component
Vuescroll
A customizable scrollbar plugin based on vue.js for PC , mobile phone, touch screen, laptop.
Stars: ✭ 1,016 (+2061.7%)
Mutual labels: component
Carbon
🚴 A declarative library for building component-based user interfaces in UITableView and UICollectionView.
Stars: ✭ 1,034 (+2100%)
Mutual labels: component
Vue Drag Resize
Vue Component for resize and drag elements
Stars: ✭ 1,007 (+2042.55%)
Mutual labels: component
Componentfixture
🛠️Interactive sandox playground for vue components
Stars: ✭ 44 (-6.38%)
Mutual labels: component
React Currency Formatter
💵 react component for currency formatting
Stars: ✭ 38 (-19.15%)
Mutual labels: component
React Native Really Awesome Button
React Native button component. Awesome Button is a 3D at 60fps, progress enabled, social ready, extendable, production ready component that renders an awesome animated set of UI buttons. 📱
Stars: ✭ 988 (+2002.13%)
Mutual labels: component
Event Dispatcher
The EventDispatcher component provides tools that allow your application components to communicate with each other by dispatching events and listening to them.
Stars: ✭ 7,946 (+16806.38%)
Mutual labels: component
Ngx Siema
Lightweight and simple carousel with no dependencies.
Stars: ✭ 46 (-2.13%)
Mutual labels: component
Shudan
A highly customizable, low-level Preact Goban component.
Stars: ✭ 43 (-8.51%)
Mutual labels: component
@pansy/watermark
✨ 特性
- 🚀 小巧,不到 5K 大小,Gzip 压缩后不到 2K
- 🌴 支持一个页面添加多处不同水印
- 🐠 支持自定义水印样式,开箱即用
- 🌈 安全防御 - 防止他人删除水印dom或修改样式属性
- 💻 使用 TypeScript 编写,提供完善的类型定义
- 📦 提供cjs、es、umd三种格式
🏗 安装
// npm
npm install @pansy/watermark --save
// yarn
yarn add @pansy/watermark
🚄 示例
🚗 框架封装
- React @pansy/react-watermark
🔨 使用
import WaterMark from '@pansy/watermark';
const waterMark = new WaterMark();
// 修改水印配置
waterMark.update({ ... });
// 渲染水印
waterMark.render();
🐚 API
update(options);
修改水印配置
render()
渲染水印
水印配置参数
参数 | 说明 | 类型 | 默认值 | 版本 |
---|---|---|---|---|
mode | 水印是重复排异还是间隔排列 |
repeat | interval
|
repeat |
1.2.0 |
monitor | 监听水印元素是否被篡改,被修改或者删除等操作,则重新渲染水印 | boolean |
true |
-- |
container | 水印挂载的容器 |
HTMLElement | sting
|
body |
|
text | 水印文本 |
string | string[]
|
-- | -- |
zIndex | 水印层级 | number |
9999 |
|
width | 单个水印区域宽度 | number |
160 |
-- |
height | 单个水印区域高度 | number |
80 |
-- |
opacity | 透明度 | number |
0.2 |
-- |
rotate | 旋转的角度 | number |
20 |
-- |
fontSize | 字体大小 | number |
14 |
-- |
fontWeight | 字体粗细 | -- | normal |
-- |
fontColor | 字体颜色 | string |
#727071 |
-- |
fontFamily | 规定字体系列 | string |
sans-serif |
-- |
textAlign | 文本对齐设置 | string |
center |
-- |
注意
-
body
使用position: fixed
- 其他采用
position: absolute
, 需保证挂载节点的不能为position: static
❤️ 感谢
🌟 社区互助
Github Issue | 钉钉群 | 微信群 |
---|---|---|
issues |
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].