Skip to content

Instantly share code, notes, and snippets.

View tomswales's full-sized avatar

Tom Swales tomswales

View GitHub Profile
// Returns the basic layout of the clock
return (
<div className="clock">
<NumeralPair value={convertedHours}/>
<Spacer/>
<NumeralPair value={this.state.date.getMinutes()}/>
<Spacer/>
<NumeralPair value={this.state.date.getSeconds()}/>
<TimeSetting timePeriod={timePeriod} timeSetting={this.state.timeSetting} toggle={this.toggleTimeSetting}/>
</div>
@tomswales
tomswales / gist:301912e0bcc835835c756bb0a4a5309d
Last active February 15, 2018 22:29
Numeral representation
const numerals = {
"1": {
top: false, top_left: false, top_right: true, middle: false, bottom_left: false, bottom_right: true, bottom: false
},
"2": {
top: true, top_left: false, top_right: true, middle: true, bottom_left: true, bottom_right: false, bottom: true
},
"3": {
top: true, top_left: false, top_right: true, middle: true, bottom_left: false, bottom_right: true, bottom: true
},