GithubHelp home page GithubHelp logo

dotted-line's Introduction

Dotted-line

一个 漂亮的背景图

test
MIT Licence
npm

需要从该项目 学习并使用的内容

  • 添加测试
  • package.json
  • README.MD 文档编写
  • npm 发布
  • 持续集成
  • 点移动的时候加入线性变化. linear, out-in.等
  • 点数量, 大小, 线的连接, 颜色渐变等.
  • 多个舞台的实现

DEMO

链接
覆盖率测试

API

实例化方法

canvas(object)

  • object: {object}
  • el: {HTMLElement} 待挂载的目标元素
  • width: {number} 宽度
  • height: {number} 高度
  • limit: {number} 点的数量
  • radius: {number} 点的半径
  • time: {number} 点移动一次所需的时间
  • color: {array} 颜色集合
  • color: {string} 颜色值.
  • isSameRadius: {boolean} 是否为相同半径
import canvas from 'dotted-line'
let stage = new canvas({
  el: document.getElementById('canvas'),
  width: 800,
  height: 800,
  limit: 15,
  pointerWidth: 15,
  time: 30,
  color: ['#f3f3f3']
})

实例方法

setLimit

设置点限制

  • params
  • limit: {number} 点限制

addPointer

添加点

delPointer

删除点

setColors

设置颜色

  • params
  • color {array} 颜色集合
  • color {string} 颜色值

setRadius

设置点的半径

  • params
  • radius {number} 半径

杏noclip 到此一游 测试pr

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.