Giter Site home page Giter Site logo

ashleylv / flip-counter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from azi3/flip-counter

0.0 3.0 0.0 129 KB

This project creates a configurable flip counter using CSS3 animations.

Home Page: https://brianjzhang.github.io/flip-counter/

JavaScript 73.32% HTML 2.89% CSS 23.79%

flip-counter's Introduction

flip-counter NPM version

This is a Flip Counter component with CSS3 animation style. It can be extended to use as a timer, countdown or else that can be represented with digits. demo

Installation

 npm install flip-counter-js --save

Usage

  1. Create an element with id of "flipCounterJs" in your HTML template.

    <div id="flipCounterJs"></div>
  2. Import FlipCounterJs module. The JavaScript file is generated by Webpack and it supports both CommonJs and AMD.

    import FlipCounter from 'flip-counter-js';

    Else you can find it on global window object.

    <script src="node_modules/flip-counter-js/dist/flip-counter-js.js"></script>
  3. Finally don't forget to include the css style.

    <link rel="stylesheet" type="text/css" href="./node_modules/flip-counter-js/dist/css/style.min.css"/>

Options

Property Type Default Description
step Number 1 The amount by which the value increases every time.
speed Number 0 The rate at which the value increases. Unit is milliseconds. Minimum value is 500. If the value is 0, the counter won't increment/decrement automatically.
minDigits Number 4 The minimum number of digits to show. You may expect leading zeros.
start Number 0 The initial value.
size String 'sm' Possible values: xs, sm, md, lg.

flip-counter's People

Contributors

azi3 avatar

Watchers

James Cloos avatar Ashley Lv avatar  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.