Skip to content

Commit d14c3b3

Browse files
committed
Readme updated.
1 parent 3edf497 commit d14c3b3

File tree

3 files changed

+92
-14
lines changed

3 files changed

+92
-14
lines changed

README.md

Lines changed: 92 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,107 @@
11
# vue-count-down-timer
2-
3-
## Project setup
2+
This is a count down timer for Vue js framework. This library supports two types of timers:
3+
1. Timer mode: Timer based on hour, minute and second.
4+
2. Single mode: Timber based on second (single circle without hours and minutes).
5+
## Installation
46
```
5-
npm install
7+
npm install vue-circular-count-down-timer
68
```
7-
8-
### Compiles and hot-reloads for development
9+
After installation, import component:
910
```
10-
npm run serve
11+
import CircularCountDownTimer from "vue-circular-count-down-timer";
1112
```
1213

13-
### Compiles and minifies for production
14+
###Documentation
15+
| Props | Description |
16+
| --- | --- |
17+
| initial_value | Initial value of timer, as seconds. (required) |
18+
| stroke-width | Thickness of circle strokes in px. |
19+
| seconds-stroke-color | Color of stroke of seconds circle. |
20+
| minutes-stroke-color | Color of stroke of minutes circle. |
21+
| hours-stroke-color | Color of stroke of hours circle. |
22+
| underneath-stroke-color | Color of stroke of empty parts of circles. |
23+
| seconds-fill-color | Color of background of seconds circle. |
24+
| minutes-fill-color | Color of background of minutes circle. |
25+
| hours-fill-color | Color of background of hours circle. |
26+
| size | Width and height of circles in px. |
27+
| padding | Space between circles in px. |
28+
| hour-label | Label of hours circle. |
29+
| minute-label | Label of minutes circle. |
30+
| second-label | Label of seconds circle. |
31+
| show-second | Whether to show seconds circle or not. |
32+
| show-minute | Whether to show minutes circle or not. |
33+
| show-hour | Whether to show hours circle or not. |
34+
| show-negatives | To continue counting after reaching zero. |
35+
| steps | Number of steps in single mode usage. |
36+
| paused | To pause counting. |
37+
38+
| Events | Description |
39+
| --- | --- |
40+
| finish | Fires when counter reach zero. |
41+
| update | Fires on each counting. |
42+
43+
### Usage
44+
####1. basic timer
1445
```
15-
npm run build
46+
<CircularCountDownTimer
47+
:initial-value="360500"
48+
></CircularCountDownTimer>
1649
```
1750

18-
### Run your tests
51+
####2. Fully customized (timer mode)
1952
```
20-
npm run test
53+
<CircularCountDownTimer
54+
:initial-value="360500"
55+
:stroke-width="5"
56+
:seconds-stroke-color="'#f00'"
57+
:minutes-stroke-color="'#0ff'"
58+
:hours-stroke-color="'#0f0'"
59+
:underneath-stroke-color="'lightgrey'"
60+
:seconds-fill-color="'#00ffff66'"
61+
:minutes-fill-color="'#00ff0066'"
62+
:hours-fill-color="'#ff000066'"
63+
:size="200"
64+
:padding="4"
65+
:hour-label="'hours'"
66+
:minute-label="'minutes'"
67+
:second-label="'seconds'"
68+
:show-second="true"
69+
:show-minute="true"
70+
:show-hour="true"
71+
:show-negatives="true"
72+
:paused="some_variable"
73+
></CircularCountDownTimer>
2174
```
2275

23-
### Lints and fixes files
76+
![fully customized timer mode](https://raw.githubusercontent.com/aanoorzaie/vue-circular-count-down-timer/raw/1.png)
77+
78+
####3. Single mode
2479
```
25-
npm run lint
80+
<CircularCountDownTimer
81+
:initial-value="200"
82+
:steps="400"
83+
></CircularCountDownTimer>
2684
```
2785

28-
### Customize configuration
29-
See [Configuration Reference](https://cli.vuejs.org/config/).
86+
![single mode](https://raw.githubusercontent.com/aanoorzaie/vue-circular-count-down-timer/raw/2.png)
87+
88+
89+
####4. Listen to events
90+
````
91+
<CircularCountDownTimer
92+
:initial-value="200"
93+
@finish="finished"
94+
@update="updated"
95+
></CircularCountDownTimer>
96+
97+
...
98+
99+
methods: {
100+
finished: () => {
101+
console.log('finished');
102+
},
103+
updated: (status) => {
104+
console.log(status); //{"value": 144, "seconds": 24, "minutes": 2, "hours": 0}
105+
}
106+
}
107+
````

raw/1.png

22.7 KB
Loading

raw/2.png

8.16 KB
Loading

0 commit comments

Comments
 (0)