Coder Social home page Coder Social logo

brendon1555 / react-analogue-clock Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 4.0 7.48 MB

An Analog Clock built with react and typescript

Home Page: https://brendon1555.github.io/react-analogue-clock/

License: MIT License

JavaScript 31.70% TypeScript 68.30%
react styled-components typescript hacktoberfest

react-analogue-clock's Introduction

AnalogueClock

React Analogue Clock

A customizable analogue clock built with styled-components in React

GitHub issues devDependencies peerDependencies License


Demo

Online demo is available


Installation

$ yarn add styled-components react-analogue-clock

or

$ npm install --save styled-components react-analogue-clock

Usage

// code away!

import AnalogueClock from 'react-analogue-clock';


const clockOptions = {
    baseColor: '#ffffff',
    borderColor: '#000000',
    borderWidth: 5,
    centerColor: '#000000',
    handColors: {
        hour: '#000000',
        minute: '#000000',
        second: '#000000',
    },
    notchColor: '#000000',
    numbersColor: '#000000',
    showNumbers: true,
    size: 300
}

<AnalogueClock {...clockOptions} />

or

Test it out with Storybook

$ yarn storybook

Props

  • baseColor: [color]
    • Background color of the clock face.
  • borderColor: [color]
    • Color of the border.
  • borderWidth: [integer]
    • Width of the border. 0 will hide the border.
  • centerColor: [color]
    • Color of the center dot.
  • handColors: [object]
    • Color of each hand.
    • hour: [color]
      • Color ogf the hour hand.
    • minute: [color]
      • Color of the minute hand.
    • second: [color]
      • Color of the second hand.
  • notchColor: [color]
    • Color of the minute notches.
  • numberColor: [color]
    • Color of the hour numbers. (if enabled)
  • showNumbers: [boolean]
    • Toggle the hour numbers.
  • size: [integer]
    • Size of the clock face in pixels.

color type defined by extra-prop-types


Contributing

To get started...

Step 1

  • Option 1

    • ๐Ÿด Fork this repo!
  • Option 2

    • ๐Ÿ‘ฏ Clone this repo to your local machine using https://github.com/brendon1555/react-analogue-clock.git

Step 2

  • HACK AWAY! ๐Ÿ”จ๐Ÿ”จ๐Ÿ”จ

Step 3


Contributors

Brendon Lees
Brendon1555
github.com/brendon1555

Support

Reach out to me at one of the following places!


License

License

react-analogue-clock's People

Contributors

brendon1555 avatar dependabot[bot] avatar kennylindley avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

react-analogue-clock's Issues

Add tests

Add some unit tests using jest/enzyme.

Add Timezone setting

It could be great if it's possible to set timezone for the clock (assume cases where you want show multiple clocks in different timezones)

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.