commit 552a4a05fe8bfbc001b83d82ad4f48237ad6078c Author: lqs <441785369@qq.com> Date: Sat Jan 18 09:03:48 2025 +0000 canvas 绘制的网页背景效果 diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..974597e --- /dev/null +++ b/.babelrc @@ -0,0 +1,28 @@ +{ + "env": { + "rollup": { + "presets": [ + [ + "env", + { + "modules": false + } + ] + ], + "plugins": [ + "transform-class-properties", + "transform-object-rest-spread", + "version" + ] + }, + "babel": { + "presets": ["env"], + "plugins": [ + "transform-class-properties", + "add-module-exports", + "transform-object-rest-spread", + "version" + ] + } + } +} diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1589f73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.project +.settings +.idea +node_modules/* +*.lock +*.log diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e27d447 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) 2015 Hust.cc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + diff --git a/README-zh.md b/README-zh.md new file mode 100644 index 0000000..b0ff203 --- /dev/null +++ b/README-zh.md @@ -0,0 +1,124 @@ +# canvas-nest.js + +> 一个基于 html5 canvas 绘制的网页背景效果。 + +[![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)](https://www.npmjs.com/package/canvas-nest.js) +[![npm](https://img.shields.io/npm/dm/canvas-nest.js.svg)](https://www.npmjs.com/package/canvas-nest.js) +[![gzip](http://img.badgesize.io/https://unpkg.com/canvas-nest.js/dist/canvas-nest.js?compression=gzip)](https://unpkg.com/canvas-nest.js/dist/canvas-nest.js) + +![screenshot](/screenshot.png) + +## 安装 +```sh +# 使用 npm +npm install --save canvas-nest.js + +# 或者使用 yarn +yarn add canvas-nest.js +``` + +## 特性 + + - 不依赖 jQuery,使用原生的 javascript。 + - 非常小,只有 2 Kb。 + - 非常容易实现,配置简单,即使你不是 web 开发者,也能简单搞定。 + - 模块化 & 区域渲染。 + + +## 使用 + + - 快捷使用 + +将下面的代码插入到 `
和 之间`. + +```html + +``` + +强烈建议在 ` + ... + ... + +`标签上方. 例如下面的代码结构: + +```html + +
+ ... + +
+