An open API service indexing awesome lists of open source software.

https://github.com/postor/text-water-mask

单元素实现页面水印,支持 react | single element text water mask, that supports react
https://github.com/postor/text-water-mask

Last synced: 2 months ago
JSON representation

单元素实现页面水印,支持 react | single element text water mask, that supports react

Awesome Lists containing this project

README

        

# text-water-mask

支持 js 和 react 的文本水印 | text water-mask for js and react

![screenshot](./examples/basic/screenshot.jpg)

高性能 | high performance
- 仅使用一个 div | single div element
- 没有事件侦听自动适应父容器 | without listeners

可定制 | fully customizable
- mask div | mask div
- 平铺背景 svg 定制 | background svg
- svg text 元素定制 | svg text element

## 使用 | usage

umd

```

document.body.appendChild(TextWaterMask.default({ text: 'hello world!!' }))

```

commonjs
```
const textWaterMask = require('text-water-mask').default
document.body.appendChild(TextWaterMask.default({ text: 'hello world!!' }))
```

react umd

```

let d = React.createElement, C = ReactTextWaterMask.default
ReactDOM.render(d('div', { style: { position: 'relative' } },
d('input'), d('p', null, `hello world!`),
d(C, { text: 'hello react!' })
), document.body)

```
react commonjs

```
import ReactTextWaterMask from 'text-water-mask/dist/react'
ReactDOM.render(



hello world!



,document.body)
```

体验 | try yourself

https://postor.github.io/text-water-mask/