├── .gitignore
├── .npmignore
├── doc
├── lifecircle.png
├── README.md
└── Janvas.jmind
├── .editorconfig
├── package.json
├── LICENSE
├── README.md
└── dist
└── janvas.min.js
/.gitignore:
--------------------------------------------------------------------------------
1 | /.idea
2 |
--------------------------------------------------------------------------------
/.npmignore:
--------------------------------------------------------------------------------
1 | /.idea
2 |
--------------------------------------------------------------------------------
/doc/lifecircle.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JarenChow/Janvas/HEAD/doc/lifecircle.png
--------------------------------------------------------------------------------
/doc/README.md:
--------------------------------------------------------------------------------
1 | # Janvas.jmind 打开方式
2 |
3 | 使用 [在线 JMind](http://janvas.cn/JMind/) 打开或者下载 [JMind](https://github.com/JarenChow/JMind) 源代码进行本地打开。
4 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | #editorconfig.org
2 | root = true
3 |
4 | [*]
5 | indent_style = space
6 | indent_size = 2
7 | end_of_line = lf
8 | charset = utf-8
9 | trim_trailing_whitespace = true
10 | insert_final_newline = true
11 | max_line_length = 999
12 |
13 | [*.md]
14 | trim_trailing_whitespace = false
15 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "janvas",
3 | "version": "2.9.9",
4 | "description": "A lightweight&simple 2D javascript library based on HTML5 Canvas.",
5 | "main": "dist/janvas.min.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1"
8 | },
9 | "repository": {
10 | "type": "git",
11 | "url": "git+https://github.com/JarenChow/Janvas.git"
12 | },
13 | "keywords": [
14 | "javascript",
15 | "canvas",
16 | "svg",
17 | "2d",
18 | "drawing",
19 | "graphic",
20 | "library"
21 | ],
22 | "author": "JarenChow",
23 | "license": "MIT",
24 | "bugs": {
25 | "url": "https://github.com/JarenChow/Janvas/issues"
26 | },
27 | "homepage": "https://github.com/JarenChow/Janvas#readme"
28 | }
29 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 JarenChow
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Janvas\[暂停更新\]
2 |
3 | A lightweight&simple 2D javascript library based on HTML5 Canvas.
4 |
5 | 一款轻量、简单的基于 HTML5 Canvas 2d 绘图上下文的 JavaScript 绘图库。
6 |
7 | 它不是框架,它只做了它该做的基础建设。
8 |
9 | ## 安装
10 |
11 | 1. ``
12 | 2. `npm install janvas --save`
13 |
14 | ## [Hello World](https://jarenchow.github.io/JanvasExamples/html/hello_world.html)
15 |
16 | - 与既有 Canvas 项目整合(功能受限)
17 | 1. ``
18 | 2. ``
19 | 3. `var ctx = document.querySelector("canvas").getContext("2d");`
20 | 4. `var text = new janvas.Text(ctx, 50, 50, "HelloWorld"); // new 一个文本`
21 | 5. `text.fill(); // 文本绘制`
22 |
23 | - 使用 janvas.Canvas 开发(全部功能)
24 |
25 | ```html
26 |
27 |
28 |
29 |
30 |
31 |
65 |
66 |
67 | ```
68 |
69 | ## Janvas 示例
70 |
71 | 详见 [JanvasExamples](https://github.com/JarenChow/JanvasExamples)
72 |
73 | 其他一些小示例写在 [CSDN](https://blog.csdn.net/M3oM3oChong) 和 [CodePen](https://codepen.io/jarenchow)
74 |
75 | ## 源代码
76 |
77 | 从一开始 **janvas** 本只想以最简洁的方式应用到项目中,所以没有以 npm 方式管理包,之后有需求与精力再重写。
78 |
79 | 目前 [janvas.min.js](./dist/janvas.min.js) 仅使用 [uglifyjs](https://github.com/mishoo/UglifyJS) --compress 简单压缩无混淆。
80 |
81 | ## 总览
82 |
83 | [Janvas.jmind](./doc/README.md)
84 |
85 | ### janvas.Canvas
86 |
87 | #### 生命周期
88 |
89 | 1. 创建:`var obj = new janvas.Canvas(options);`
90 | 2. 周期:
91 | 3. 销毁:`obj.$destroy();`,将发生:
92 | - 移除事件监听器
93 | - 停止动画
94 | - 移除 `