1.5.0 โ€ข Published 3 years ago

ras-react-component v1.5.0

Weekly downloads
244
License
ISC
Repository
-
Last release
3 years ago

downloads language license

REACT ANALOG CLOCK

Just an analog clock for your React app.

Github

Sasicrastko/REACT-ANALOG-CLOCK

NPM

ras-react-component

Demo

You can play with the clock HERE and choose its look by setting characteristics!

Installation

Add this analog clock to your project by executing npm install --save ras-react-component or yarn add ras-react-component.

Elements

The watch consists of the base, minute scale, hour scale, numbers, hands and the center dot. The bese consist of four concentric circles placed one over other. Numbers can be Roman and Arabic and they can take horizontal and radial position. elements

Usage

An example of usage:

import React, { Component } from 'react';
import AnalogClock from 'ras-react-component';

const style = {
    showRomanNumbers: false,
    showMinuteScale: true,
    showHourScale: true,
    showNumbers: true,
    radialDirectionOfNumbers: false,
    colorOfScalesAndNumbers: `black`,
    hourHandColor: `#151515`,
    minuteHandColor: `black`,
    secondHandColor: `red`,
    firstCircleColor: `white`,
    secondCircleColor: `white`,
    thirdCircleColor: `white`,
    fourthCircleColor: `black`,
    centerDotColor: `black`,
    width: 300,
    numberSize: 150,
    iana: `Europe/Dublin`
}

class App extends Component {

  render() {
    return (
      <div>
        <AnalogClock style={style}/>
      </div>
    );
  }
}

export default App;

Properties

Since v1.2.0 there is no showRomanNumbers but there is numerals instead. This enables usage of different numerical systems or characters an emojis. numerals

CharacteristicDescriptionExample valuesDefault value
widthNumber that determines clock width (in pixels). It should be an integer.400300
numeralsArray or string that determines what numerical system is used for numbers. Default value is "western_arabic". If it is array all elements must be strings."western_arabic", "eastern_arabic", "roman", "persian", "chinese", "devanagariโ€", "tamil", "bengali", "gujarati", "korean", "hebrew" or a string array like ["", "", "3","", "", "6","", "", "9","", "", "12"] or with emojis ["๐Ÿด","๐Ÿฎ","๐Ÿท","๐Ÿน","๐Ÿ—","๐Ÿป","๐Ÿ”","๐Ÿต","๐Ÿถ","๐ŸฆŠ","๐Ÿฑ"]"western_arabic"
showMinuteScaleBoolean value that determines if the minute scale should be rendered.true or falsetrue
showHourScaleBoolean value that determines if the hour scale should be rendered.true or falsetrue
showNumbersBoolean value that determines if the numbers should be rendered.true or falsetrue
radialDirectionOfNumbersBoolean value that determines if the numbers should be rendered radialy. By default they are rendered horizontallytrue or falsefalse
colorOfScalesAndNumbersString that determines color of the scales and the numbers."black" or "#1a1a1a" or "rgb(255,0,0)" or "transparent""black"
hourHandColorString that determines color of the hour hand."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""#151515"
minuteHandColorString that determines color of the minute hand."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""black"
secondHandColorString that determines color of the second hand."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""red"
firstCircleColorString that determines color of the first concentric circle."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""white"
secondCircleColorString that determines color of the second concentric circle."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""white"
thirdCircleColorString that determines color of the third concentric circle."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""white"
fourthCircleColorString that determines color of the fourth concentric circle."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""black"
centerDotColorString that determines color of the dot in the center."black" or "#1a1a1a" or "rgb(15,15,15)" or "transparent""black"
numberSizeNumber that determines the size of the numbers. It should be an integer.400300
ianaString that determines the time zone. It should be in IANA format."America/Chicago" or undefined, null and "" for local time"Europe/London"

Examples

The look of the watch can be set on many ways and some of examples are on the image bellow. examples

License

The ISC License

Author

Rastko Sasic

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.3.0

3 years ago

1.2.0

3 years ago

1.2.1

3 years ago

1.1.70

3 years ago

1.1.80

3 years ago

1.1.60

3 years ago

1.1.50

5 years ago

1.1.40

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.92

5 years ago

1.0.91

5 years ago

1.0.90

5 years ago

1.0.9

5 years ago

1.0.84

5 years ago

1.0.83

5 years ago

1.0.82

5 years ago

1.0.81

5 years ago

1.0.80

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago