Skip to content

Commit 7f9e906

Browse files
committed
Merge branch 'master' into gh-pages
Conflicts: CHANGELOG.md package.json
2 parents 038caf3 + 9d22b49 commit 7f9e906

File tree

9 files changed

+66
-1714
lines changed

9 files changed

+66
-1714
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
11
# Changelog
22

3+
## 1.0.7 - Aug 7, 2016
4+
5+
* Weight of circle can now be configured. Thanks @rutan.
6+
7+
## 1.0.6 - Feb 18, 2016
8+
9+
* Added licence
10+
311
## 1.0.5 - Dec 22, 2015
412

513
* Removed React into peerDependencies
14+
* Removed Shrinkwrap
615

716
## 1.0.5 - Dec 21, 2015
817

LICENSE.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
Copyright (c) 2016, Hugh Gallagher
2+
3+
Permission to use, copy, modify, and/or distribute this software for any
4+
purpose with or without fee is hereby granted, provided that the above
5+
copyright notice and this permission notice appear in all copies.
6+
7+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ npm install react-countdown-clock
3030
* `color` you'd like it to be as a hex/css colour code
3131
* `alpha` transparency for component
3232
* `size` for height and width of canvas element, in pixels.
33+
* `weight` for weight of circle, in pixels.
3334
* `onComplete` callback when timer completes
3435

3536
## Bugs

RELEASE_PROCESS.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Just to remind myself of my own release process for this repo
2+
3+
1. Make some changes / merge PR
4+
2. Bump version in `package.json`
5+
3. Update `README.md` if needed
6+
4. Update `CHANGELOG.md`
7+
5. Webpack build
8+
```
9+
webpack -p
10+
```
11+
6. Test it all works
12+
```
13+
serve
14+
open index.html -a 'Google Chrome'
15+
```
16+
7. Tag and push the release
17+
```
18+
git tag 1.0.x
19+
git push
20+
git push --tags
21+
```
22+
8. Publish on NPM
23+
```
24+
npm publish
25+
```
26+
9. Cup of tea

build/react-countdown-clock.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/react-countdown-clock.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coffee/react-countdown-clock.coffee

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ module.exports = React.createClass
99
_timeoutIds: []
1010

1111
displayName: 'ReactCountdownClock'
12-
12+
1313
propTypes:
1414
seconds: React.PropTypes.number
1515
size: React.PropTypes.number
16+
weight: React.PropTypes.number
1617
color: React.PropTypes.string
1718
alpha: React.PropTypes.number
1819
onComplete: React.PropTypes.func
@@ -44,9 +45,14 @@ module.exports = React.createClass
4445
@_drawTimer()
4546

4647
_setScale: ->
47-
@_radius = @props.size / 2
48-
@_fraction = 2 / @_seconds
49-
@_tickPeriod = @_seconds * 1.8
48+
@_radius = @props.size / 2
49+
@_fraction = 2 / @_seconds
50+
@_tickPeriod = @_seconds * 1.8
51+
@_innerRadius =
52+
if @props.weight
53+
@_radius - @props.weight
54+
else
55+
@_radius / 1.8
5056

5157
_setupCanvas: ->
5258
@_canvas = @refs.canvas
@@ -89,8 +95,8 @@ module.exports = React.createClass
8995
_drawBackground: ->
9096
@_context.beginPath()
9197
@_context.globalAlpha = @props.alpha / 3
92-
@_context.arc @_radius, @_radius, @_radius, 0, Math.PI * 2, false
93-
@_context.arc @_radius, @_radius, @_radius/1.8, Math.PI * 2, 0, true
98+
@_context.arc @_radius, @_radius, @_radius, 0, Math.PI * 2, false
99+
@_context.arc @_radius, @_radius, @_innerRadius, Math.PI * 2, 0, true
94100
@_context.fill()
95101

96102
_drawTimer: ->
@@ -100,8 +106,8 @@ module.exports = React.createClass
100106
@_context.fillStyle = @props.color
101107
@_context.fillText @_seconds.toFixed(decimals), @_radius, @_radius
102108
@_context.beginPath()
103-
@_context.arc @_radius, @_radius, @_radius, Math.PI * 1.5, Math.PI * percent, false
104-
@_context.arc @_radius, @_radius, @_radius/1.8, Math.PI * percent, Math.PI * 1.5, true
109+
@_context.arc @_radius, @_radius, @_radius, Math.PI * 1.5, Math.PI * percent, false
110+
@_context.arc @_radius, @_radius, @_innerRadius, Math.PI * percent, Math.PI * 1.5, true
105111
@_context.fill()
106112

107113
render: ->

0 commit comments

Comments
 (0)