Add dashboard
This commit is contained in:
18
widgets/clock/clock.coffee
Normal file
18
widgets/clock/clock.coffee
Normal file
@@ -0,0 +1,18 @@
|
||||
class Dashing.Clock extends Dashing.Widget
|
||||
|
||||
ready: ->
|
||||
setInterval(@startTime, 500)
|
||||
|
||||
startTime: =>
|
||||
today = new Date()
|
||||
|
||||
h = today.getHours()
|
||||
m = today.getMinutes()
|
||||
s = today.getSeconds()
|
||||
m = @formatTime(m)
|
||||
s = @formatTime(s)
|
||||
@set('time', h + ":" + m + ":" + s)
|
||||
@set('date', today.toDateString())
|
||||
|
||||
formatTime: (i) ->
|
||||
if i < 10 then "0" + i else i
|
||||
2
widgets/clock/clock.html
Normal file
2
widgets/clock/clock.html
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1 data-bind="date"></h1>
|
||||
<h2 data-bind="time"></h2>
|
||||
13
widgets/clock/clock.scss
Normal file
13
widgets/clock/clock.scss
Normal file
@@ -0,0 +1,13 @@
|
||||
// ----------------------------------------------------------------------------
|
||||
// Sass declarations
|
||||
// ----------------------------------------------------------------------------
|
||||
$background-color: #dc5945;
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Widget-clock styles
|
||||
// ----------------------------------------------------------------------------
|
||||
.widget-clock {
|
||||
|
||||
background-color: $background-color;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user