From 2fdc9effc2d9e63fc884bfa689dfe6764dd346a5 Mon Sep 17 00:00:00 2001 From: hustcc Date: Sat, 23 Jun 2018 11:32:46 +0800 Subject: [PATCH] module & area render --- .babelrc | 26 +++++++ .gitignore | 2 +- .jshintrc | 13 ---- .travis.yml | 3 - README-zh.md | 60 +++++++++++---- README.md | 79 ++++++++++++++------ dist/canvas-nest.js | 119 +----------------------------- dist/canvas-nest.min.js | 7 -- dist/canvas-nest.umd.js | 1 + gulpfile.js | 16 ---- index.html | 76 ++++++++++++++----- lib/CanvasNest.js | 159 ++++++++++++++++++++++++++++++++++++++++ lib/iife.js | 24 ++++++ lib/index.js | 18 +++++ lib/utils.js | 23 ++++++ package.json | 61 +++++++++++---- rollup.config.iife.js | 29 ++++++++ rollup.config.umd.js | 30 ++++++++ src/CanvasNest.js | 126 +++++++++++++++++++++++++++++++ src/canvas-nest.js | 118 ----------------------------- src/iife.js | 20 +++++ src/index.js | 8 ++ src/utils.js | 19 +++++ 23 files changed, 691 insertions(+), 346 deletions(-) create mode 100644 .babelrc delete mode 100644 .jshintrc delete mode 100644 .travis.yml delete mode 100644 dist/canvas-nest.min.js create mode 100644 dist/canvas-nest.umd.js delete mode 100644 gulpfile.js create mode 100644 lib/CanvasNest.js create mode 100644 lib/iife.js create mode 100644 lib/index.js create mode 100644 lib/utils.js create mode 100644 rollup.config.iife.js create mode 100644 rollup.config.umd.js create mode 100644 src/CanvasNest.js delete mode 100644 src/canvas-nest.js create mode 100644 src/iife.js create mode 100644 src/index.js create mode 100644 src/utils.js diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..9b21973 --- /dev/null +++ b/.babelrc @@ -0,0 +1,26 @@ +{ + "env": { + "rollup": { + "presets": [ + [ + "env", + { + "modules": false + } + ] + ], + "plugins": [ + "transform-class-properties", + "transform-object-rest-spread" + ] + }, + "babel": { + "presets": ["env"], + "plugins": [ + "transform-class-properties", + "add-module-exports", + "transform-object-rest-spread" + ] + } + } +} diff --git a/.gitignore b/.gitignore index 3f875d7..dd93304 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ .project .settings - +.idea node_modules/* diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index f2772a8..0000000 --- a/.jshintrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "quotmark": true, - "boss": true, - "eqnull": true, - "expr": true, - "funcscope": true, - "loopfunc": true, - "smarttabs": true, - "node": true, - "browser": true, - "undef": true, - "unused": true -} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aacd2fb..0000000 --- a/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "4.4.4" \ No newline at end of file diff --git a/README-zh.md b/README-zh.md index ab83bc3..403c9a2 100644 --- a/README-zh.md +++ b/README-zh.md @@ -1,25 +1,27 @@ # canvas-nest.js -> 一个基于html5 canvas绘制的网页背景效果,非常赞!如果需要 `wordpress插件`,在插件库搜索 `canvas-nest` 或者看看项目 [canvas-nest-for-wp](https://github.com/aTool-org/canvas-nest-for-wp)。 +> 一个基于 html5 canvas 绘制的网页背景效果,非常赞!如果需要 `wordpress插件`,在插件库搜索 `canvas-nest` 或者看看项目 [canvas-nest-for-wp](https://github.com/aTool-org/canvas-nest-for-wp)。 -![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) +[![npm](https://img.shields.io/badge/demo-online-brightgreen.svg)](https://git.hust.cc/canvas.nest.js) +![npm](https://img.shields.io/npm/v/canvas-nest.js.svg) +![npm](https://img.shields.io/npm/dm/canvas-nest.js.svg) ## 特性 - - 不依赖任何框架或者类库,比如不依赖 jQuery,使用原生的 javascript。 - - 非常小,只有1.6 kb,如果开启 gzip,可以更小。 - - 非常容易实现,配置简单,即使你不是web开发者,也能简单搞定。 + - 不依赖 jQuery,使用原生的 javascript。 + - 非常小,只有 2 Kb。 + - 非常容易实现,配置简单,即使你不是 web 开发者,也能简单搞定。 ## 使用 -使用非常简单,感觉都没有必要写这一节内容。 + - 快捷使用 将下面的代码插入到 ` 和 之间`. ```html - + ``` 强烈建议在 `
... ... - ... - +