Giter VIP home page Giter VIP logo

simple-circle-progress's Introduction

simple-circle-progress

a simple circe progress

demo -->

usage

const circle = circleProgress ({
  canvas,
  isAnim = true, // default, click the circle to trigger animation
  rate, // number
  clockwise,
  dash,
  lineCap,
  circleStyle = '#000000', // default
  lineWidth = 10, // default
  orbitStyle = '',
  textStyle = '#000000', // default
  textBaseline = 'middle' // default
})

// plus

circle.onComplete(()=>{
  // progress done
})

// you can click the circle to trigger animation or do this
circle.anim() // trigger animation

examples

demo

// npm install simple-circle-progress
import circleProgress from 'simple-circle-progress'

circleProgress({
  canvas: document.getElementById('canvas0'),
  rate: 80
})

circleProgress({
  canvas: document.getElementById('canvas1'),
  rate: 76,
  orbitStyle: '#ffffff',
  circleStyle: '#2879ff'
})

circleProgress({
  canvas: document.getElementById('canvas2'),
  rate: 88,
  circleStyle: '#ffd50a',
  dash: true,
  orbitStyle: '#ffffff',
  textBaseline: 'alphabetic'
});

circleProgress({
  canvas: document.getElementById('canvas3'),
  rate: 82,
  circleStyle: '#84d276',
  textStyle: '#E57373',
  clockwise: true,
  textBaseline: 'hanging'
})

circleProgress({
  canvas: document.getElementById('canvas4'),
  rate: 78,
  circleStyle: '#E57373',
  textStyle: '',
  lineCap: 'round',
  lineWidth: 18
})

// or
<script src="https://nicoleffect.github.io/simple-circle-progress/dist/simple-circle-progress.iife.min.js"></script>

circleProgress({
  canvas: document.getElementById('canvas0'),
  rate: 80
})

all modes

amd、cjs、es、iife、umd

simple-circle-progress's People

Watchers

James Cloos avatar

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.