Skip to content

Commit 98618b9

Browse files
committed
docs: update README.md
1 parent 40ea61f commit 98618b9

File tree

2 files changed

+41
-9
lines changed

2 files changed

+41
-9
lines changed

README.md

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
11
# Vuepress Plugin HeroPattern
22

3+
<p align="center">
4+
<a href="https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern">
5+
<img src="./assets/images/logo.png">
6+
</a>
7+
</p>
8+
9+
<p align="left">
10+
<a href="https://www.npmjs.com/package/vuepress-plugin-hero-pattern"><img src="https://img.shields.io/npm/v/vuepress-plugin-hero-pattern.svg?maxAge=2592000"></a>
11+
<a href="https://www.npmjs.com/package/vuepress-plugin-hero-pattern"><img src="https://img.shields.io/npm/dt/vuepress-plugin-hero-pattern.svg"></a>
12+
<a href="https://raw.githubusercontent.com/vueblocks/vuepress-plugin-hero-pattern/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg"></a>
13+
</p>
14+
315
Register a global `<HeroPattern />` component for VuePress.
416

5-
This component generate a seemless SVG background pattern.
17+
This component generate a seemless SVG background pattern as a background image.
618

7-
> This plugin is a adaptor of [hero-pattern](http://www.heropatterns.com/) for VuePress
19+
> This plugin is a VuePress implementation of [Hero Patterns](http://www.heropatterns.com/), All 87 unstyled svg icons is optimized with svgo.
820
921
## See Demo on CodeSandbox
1022

11-
[![Edit vuepress-plugin-hero-pattern](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/musing-surf-twidv?fontsize=14&hidenavigation=1&theme=dark)
23+
[![Edit vuepress-plugin-hero-pattern](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/vuepress-plugin-hero-pattern-o1ebr?fontsize=14&hidenavigation=1&theme=dark)
1224

1325
## Installation
1426

@@ -34,17 +46,37 @@ module.exports = {
3446

3547
## Usage
3648

37-
> Only background image, you must give the width & height of the element
49+
### Default
50+
51+
I pick `line-to-motion` as the preset pattern.
52+
53+
> Only background image, you must give the height of the element
54+
55+
```vue
56+
<HeroPattern style="height: 160px;" />
57+
```
58+
59+
### Pick a Pattern
60+
61+
Hero Pattern provide 87 kinds of pattern you can choose, check [pattern list](https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern/tree/master/assets/icons)
3862

3963
```vue
40-
<HeroPattern style="width: 240px; height: 80px;" />
64+
<HeroPattern
65+
style="height: 160px;"
66+
pattern="glamorous"
67+
fill-color="#FAF5FF"
68+
background-color="#553C9A"
69+
fill-opacity=".66"
70+
/>
4171
```
4272

43-
> With the custom slot, in the case, you can let the slot element control the pattern's height
44-
÷
73+
### With the custom slot
74+
75+
> In the case, you can let the slot element control the pattern's height
76+
4577
```vue
4678
<hero-pattern>
47-
<div style="padding: 64px; font-size: 2rem; color: white;">
79+
<div style="padding: 64px; font-size: 2rem; font-weight: bold; color: white;">
4880
All Posts
4981
</div>
5082
</hero-pattern>
@@ -54,7 +86,7 @@ module.exports = {
5486

5587
| Props | Description | Type | Default |
5688
| :---: | :---------: | :--: | :-----: |
57-
| pattern | 87 kinds of patterns that Hero Patterns supported, check [pattern list]() | String | `line-to-motion` |
89+
| pattern | 87 kinds of patterns that Hero Patterns supported, check [pattern list](https://github.com/xiaoluoboding/vuepress-plugin-hero-pattern/tree/master/assets/icons) | String | `line-to-motion` |
5890
| fillColor | Controls the foreground color of the generated image. | String | `#9c92ac` |
5991
| fillOpacity | Controls the foreground opacity of the generated image. | String | `0.4` |
6092
| backgroundColor | Controls the background color of the generated image. | String | `#dfdbe5` |

assets/images/logo.png

821 KB
Loading

0 commit comments

Comments
 (0)