2
2
3
3
> A nest backgroud of website draw on canvas. [ 中文Readme帮助文档] ( https://github.com/hustcc/canvas-nest.js/blob/master/README-zh.md ) . For ` wordpress plugin ` , search ` canvas-nest ` or see [ canvas-nest-for-wp] ( https://github.com/aTool-org/canvas-nest-for-wp ) .
4
4
5
- ![ travis-ci] ( https://travis-ci.org/hustcc/canvas-nest.js.svg?branch=master ) ![ npm] ( https://img.shields.io/npm/v/canvas-nest.js.svg?style=flat-square ) ![ npm] ( https://img.shields.io/npm/l/canvas-nest.js.svg?style=flat-square )
5
+ [ ![ npm] ( https://img.shields.io/badge/demo-online-brightgreen.svg )] ( https://git.hust.cc/canvas.nest.js )
6
+ ![ npm] ( https://img.shields.io/npm/v/canvas-nest.js.svg )
7
+ ![ npm] ( https://img.shields.io/npm/dm/canvas-nest.js.svg )
6
8
7
9
10
+ ## Feature
8
11
9
- ## feature
12
+ - No need jQuery.
13
+ - Light, only 2 Kb.
14
+ - Easy to use, even you are not a web developer.
10
15
11
- - do not depend on jQuery or other javascript framework.
12
- - very light, only 1.6 kb. can be smaller after gzip.
13
- - so easy to use, even you are not a web developer.
14
16
17
+ ## Usage
15
18
16
- ## usage
19
+ - Script tag
17
20
18
- so eazy that I do not want write the chapter.
19
-
20
- insert the code below ` between <body> and </body> ` .
21
+ Insert the code below ` between <body> and </body> ` .
21
22
22
23
``` html
23
- <script src =" //cdn.bootcss.com/canvas-nest.js/1.0.1 /canvas-nest.min .js" ></script >
24
+ <script src =" //cdn.bootcss.com/canvas-nest.js/x.x.x /canvas-nest.js" ></script >
24
25
```
25
26
26
- suggest before the tag ` </body> ` . like below:
27
+ Suggest before the tag ` </body> ` , like below:
27
28
28
29
``` html
29
30
<html >
@@ -33,19 +34,36 @@ suggest before the tag `</body>`. like below:
33
34
<body >
34
35
...
35
36
...
36
- ...
37
- <script src =" //cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js" ></script >
37
+ <script src =" //cdn.bootcss.com/canvas-nest.js/x.x.x/canvas-nest.js" ></script >
38
38
</body >
39
39
</html >
40
40
```
41
41
42
+ Then ok! ` Please do not add the code in the <head> </head> ` .
43
+
44
+
45
+ - Module usage (Area render)
46
+
47
+ > npm i --save canvas-nest.js
48
+
49
+ Or import the ` umd ` package use ` script ` tag.
50
+
51
+ There is only one API, use it like:
52
+
53
+ ```
54
+ import CanvasNest from 'canvas-nest.js';
42
55
43
- ` please do not add the code in the <head> </head> ` .
56
+ const config = {
57
+ color: '255,0,0',
58
+ count: 88,
59
+ };
44
60
45
- then ok!
61
+ // render nest on element with config.
62
+ new CanvasNest(element, config);
63
+ ```
46
64
47
65
48
- ## config
66
+ ## Config
49
67
50
68
- ** ` color ` ** : the canvas line color, default: ` '0,0,0' ` ; the color is (R,G,B)
51
69
- ** ` opacity ` ** : the opacity of line (0~ 1), default: ` 0.5 `
@@ -55,23 +73,40 @@ then ok!
55
73
Example:
56
74
57
75
``` html
58
- <script type =" text/javascript" color =" 0,0,255" opacity =' 0.7' zIndex =" -2" count =" 99" src =" //cdn.bootcss.com/canvas-nest.js/1.0.1/canvas-nest.min.js" ></script >
76
+ <script type =" text/javascript" color =" 0,0,255" opacity =' 0.7' zIndex =" -2" count =" 99" src =" //cdn.bootcss.com/canvas-nest.js/x.x.x/canvas-nest.js" ></script >
77
+ ```
78
+
79
+ Or
80
+
81
+ ``` js
82
+ {
83
+ color: ' 0,0,255' ,
84
+ opacity: 0.7 ,
85
+ zIndex: - 2 ,
86
+ count: 99 ,
87
+ };
59
88
```
60
89
61
90
set the config on the script node ` as a attribute ` . all the config has the default value, you can choose to set any of them.
62
91
63
92
64
- ## preview
93
+ ## Preview
65
94
66
95
1 . [ Online Tools: https://atool.vip/ ] ( https://atool.vip/ )
67
96
68
- if you has used this project, pls let me know, I can add your website on.
97
+
98
+ If you has used this project, you can send pr and write it here.
99
+
69
100
70
101
![ screenshot] ( https://raw.githubusercontent.com/hustcc/canvas-nest.js/master/screenshot.png )
71
102
72
103
73
- ## other
104
+ ## Other
105
+
106
+ Library cdn url: [ http://www.bootcdn.cn/canvas-nest.js/ ] ( http://www.bootcdn.cn/canvas-nest.js/ ) .
107
+
108
+
74
109
75
- Project library cdn url: [ http://www.bootcdn.cn/canvas-nest.js/ ] ( http://www.bootcdn.cn/canvas-nest.js/ ) .
110
+ ## License
76
111
77
- any bug or question, welcome to push request and issue .
112
+ MIT@ [ hustcc ] ( https://github.com/hustcc ) .
0 commit comments