-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
256 lines (244 loc) · 13.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
<!DOCTYPE html>
<html ng-app="SmartMirror">
<head ng-controller="Theme">
<meta charset="utf-8">
<title>Smart Mirror</title>
<script>
const annyang = require('annyang')
const fs = require('fs')
// Error logging
window.onerror = function (errorMsg, url, lineNumber) {
fs.appendFileSync('./smart-mirror.log', '['+ new Date().toString() + '] '
+ errorMsg + '| Script: ' + url + ' Line: ' + lineNumber + '\n');
}
</script>
<!-- bower:js -->
<script src="bower_components/moment/min/moment-with-locales.js"></script>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/angular-animate/angular-animate.js"></script>
<script src="bower_components/angular-dynamic-locale/src/tmhDynamicLocale.js"></script>
<script src="bower_components/angular-translate/angular-translate.js"></script>
<script src="bower_components/angular-translate-loader-static-files/angular-translate-loader-static-files.js"></script>
<script src="bower_components/rrule/lib/rrule.js"></script>
<!-- endbower -->
<script src="js/inc/skycons.js"></script>
<script src="https://connect.soundcloud.com/sdk/sdk-3.0.0.js"></script>
<!-- App -->
<script src="config.js"></script>
<script src="js/app.js"></script>
<script src="js/services/timebox.js"></script>
<script src="js/services/soundcloud.js"></script>
<script src="js/services/search.js"></script>
<script src="js/services/speech.js"></script>
<script src="js/services/weather.js"></script>
<script src="js/services/comic.js"></script>
<script src="js/services/map.js"></script>
<script src="js/services/light.js"></script>
<script src="js/services/giphy.js"></script>
<script src="js/services/timer.js"></script>
<script src="js/services/geolocation.js"></script>
<script src="js/services/calendar.js"></script>
<script src="js/services/traffic.js"></script>
<script src="js/services/fitbit.js"></script>
<script src="js/services/reminder.js"></script>
<script src="js/services/rss.js"></script>
<script src="js/services/tvshows.js"></script>
<script src="js/services/autosleep.js"></script>
<script src="js/services/stock.js"></script>
<script src="js/services/scrobbler.js"></script>
<script src="js/controller.js"></script>
<!-- Styles and Resources -->
<link rel="shortcut icon" href="favicon.ico" />
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300,400,600,800,700' rel='stylesheet' type='text/css'>
<link rel="stylesheet" ng-href="css/{{ layoutName }}.css" />
<link rel="stylesheet" href="css/weather-icons.css">
<!-- bower:css -->
<!-- endbower -->
</head>
<body ng-controller="MirrorCtrl" ng-cloak="">
<div class="top">
<div class="top-left">
<div class="date grey"><span ng-bind="date.format('dddd')"></span>, <span ng-bind="date.format('LL')"></span></div>
<div class="time" ng-bind="date.format('LT')"></div>
<ul class="calendar fade" ng-show="focus == 'default'" ng-class="config.calendar.showCalendarNames ? 'show-calendar-names' : ''">
<li class="event" ng-repeat="event in calendar" ng-class="(calendar[$index - 1].label != event.label) ? 'day-marker' : ''">
<div class="event-details">
<span class="day">
<span ng-bind="event.startName"></span>
<span ng-if="event.startName != event.endName"> - <span ng-bind="event.endName"></span></span>
</span>
<div class="details calendar-name" ng-bind="event.calendarName"></div>
<span class="summary" ng-bind="event.SUMMARY"></span>
<div class="details" ng-if="event.start.format('LT') != event.end.format('LT')">
<span ng-if="event.startName != event.endName"><span ng-bind="event.start.format('M/D')"></span> <span ng-bind="event.start.format('LT')"></span> - <span ng-bind="event.end.format('M/D')"></span> <span ng-bind="event.end.format('LT')"></span></span>
<span ng-if="event.startName == event.endName"><span ng-bind="event.start.format('LT')"></span> - <span ng-bind="event.end.format('LT')"></span></span>
</div>
<div class="details" ng-if="event.start.format('LT') == event.end.format('LT')">All day</div>
</div>
</li>
</ul>
</div>
<div class="top-right">
<div class="weather">
<div class="weather-today">
<span class="icon dimmed wi {{currentForecast.wi}}"></span>
<canvas id="icon_weather_current" width="90" height="70"></canvas>
<span class="temperature" ng-show="currentForecast.temperature" ng-bind="currentForecast.temperature + '°'"></span>
</div>
<div class="weather-week-descriptor">
<span ng-bind="minutelyForecast.summary"></span>
<span ng-bind="hourlyForecast.summary"></span>
<span ng-bind="weeklyForecast.summary"></span>
</div>
<div class="weather-week" ng-repeat="forecast in weeklyForecast.data" ng-if="$index > 0">
<div class="weather-week-day">
<span class="day light-grey" ng-bind="forecast.day"></span>
<canvas id="icon_weather_{{forecast.counter}}" width="33" height="25"></canvas>
<span class="icon-small dimmed wi wi-fw {{forecast.wi}}"></span>
<span class="temperature temperature-min" ng-bind="forecast.temperatureMin + '°'"></span>
<span class="temperature temperature-max" ng-bind="forecast.temperatureMax + '°'"></span>
</div>
</div>
<!-- Workaround: -->
<div style="display: none;" ng-repeat="forecast in weeklyForecast.data" ng-if="$index > 0">
<span ng-init="iconLoad('icon_weather_'+forecast.counter, forecast.iconAnimation)"></span>
</div>
</div>
<div class="traffic" ng-repeat="traffic in trips">
<div ng-show="!traffic.error" class="traffic-information">
<span class="time-to" ng-bind="'traffic.time_to' | translate:traffic"></span>
<span ng-bind="traffic.duration.humanize()"></span>
</div>
</div>
<div class="stock">
<div class="stock-information" ng-repeat="quote in stock">
<span><i class="fa fa-rss fade" style="margin-right: 5px";></i></span>
<span fade ng-bind="quote.Name"></span>: $<span fade ng-bind="quote.LastTradePriceOnly | number : 3"></span>
<span ng-bind="quote.Change"></span>
</div>
</div>
<div class="tvshows">
<div class="tv-information time-to" ng-repeat="show in tvshows">
<span><i class="fa fa-rss fade" style="margin-right: 5px";></i></span>
<span fade><span style="font-weight: bold" ng-bind="show.data.episode.show.title"></span> – <span ng-bind="show.data.episode.release_date"></span></span>
</div>
</div>
</div>
</div>
<div class="container" ng-class="(listening == true)?'listening':'not-listening'">
<div class="middle-center">
<h1 ng-bind="greeting"></h1>
<div class="contents-box video-container animate-grow" ng-show="focus == 'video'">
<iframe class="video animate-grow" ng-src="{{video}}" /></iframe>
</div>
<div class="contents-box sc-container animate-grow" ng-show="focus == 'sc'">
<audio id="player" controls="" autoplay="" preload autobuffer style="display: none"></audio>
<div>
<canvas id="visualizer" width="300" height="150"></canvas>
</div>
<img class="sc" ng-src="{{scThumb}}" />
<img class="scWaveform" ng-src="{{scWaveform}}" />
<h2 class="sc" ng-bind="scTrack"></h2>
</div>
<div class="contents-box map animate-grow" ng-show="focus == 'map'">
<img class="contents map animate-grow" ng-src="{{map}}" />
</div>
<div class="contents-box gif animate-grow" ng-show="focus == 'gif'">
<img class="contents gif animate-grow" ng-src="{{gifimg}}" />
</div>
<div class="xkcd-container animate-grow" ng-show="focus == 'xkcd'">
<img class="xkcd animate-grow" ng-src="{{xkcd}}" />
</div>
<div class="dilbert-container animate-grow" ng-show="focus == 'dilbert'">
<img class="dilbert animate-grow" ng-src="{{dilbert.content}}" />
<div class="comic-title" ng-bind="dilbert.title"></div>
</div>
<div class="reminders-container animate-grow" ng-show="focus == 'reminders'">
<ul>
<li class="reminders animate-grow" ng-repeat="reminder in reminders">
<span class="reminder" ng-bind="reminder"></span>
</li>
</ul>
</div>
<div class="contents-box animate-grow" ng-if="focus == 'timer'">
<div class="contents timer animate-grow">
<div class="timer-countdown" ng-bind="timer.countdown | secondsToDateTime | date:'mm:ss'"></div>
<div class="timer-duration grey" ng-bind="timer.duration | secondsToDateTime | date:'mm:ss''"></div>
<timer-circle class="timer-circle" />
</div>
</div>
</div>
<div class="bottom-center">
<!-- Command list -->
<div class="commands animate-grow" ng-if="focus == 'commands'">
<h2 ng-bind="'commands.title' | translate"></h2>
<dl>
<dt ng-repeat-start="command in commands" ng-bind="command['text']"></dt>
<dd ng-repeat-end ng-bind="command['description']"></dd>
<dt ng-show="fitbitEnabled">Show my walking</dt>
<dd ng-show="fitbitEnabled">Refreshes fitbit data.</dd>
</dl>
</div>
<div class="news">
<div class="fade" ng-if="focus == 'default' && news">
<div class="news-title dimmed fade">
<span><i class="fa fa-rss fade" style="margin-right: 5px";></i></span>
<span fade>Source: <span ng-bind="news.title"></span>, Last Updated: <span ng-bind="news.lastUpdated.format('MMM DD, h:mm a')"></span></span>
</div>
<div class="news-content fade">
<span class="fade" ng-bind="news.content"></span>
</div>
</div>
</div>
<div class="error" ng-bind="speechError" ng-show="speechError"></div>
<div class="partial-result" ng-bind="partialResult" ng-hide="speechError"></div>
</div>
<div class="bottom-left">
<div class="fitbit" ng-if="fitbitEnabled">
<div><span class="fitbit-title">{{'fitbit.statsFor' | translate}} {{fbDailyAverage.fullName}}</span></div>
<div><span class="fitbit-item">{{'fitbit.averageSteps' | translate}}: {{fbDailyAverage.averageDailySteps}}</span></div>
<div><span class="fitbit-item">{{'fitbit.todaysSteps' | translate}}: {{fbToday.summary.steps}}</span></div>
<div><span class="fitbit-item">{{'fitbit.todaysDistance' | translate}}: {{fbToday.summary.distances[0].distance}} km</span></div>
<div><span class="fitbit-item">{{'fitbit.todaysActiveMinutes' | translate}}: {{(fbToday.summary.veryActiveMinutes) + (fbToday.summary.fairlyActiveMinutes)}} min</span></div>
<div><span class="fitbit-item">{{'fitbit.caloriesBurned' | translate}}: {{fbToday.summary.caloriesOut}} kcal</span></div>
<p></p>
<div><span class="fitbit-subtitle" ng-show="fbSleep.sleep[0]">{{'fitbit.sleepLastNight' | translate}}</span></div>
<div><span class="fitbit-item" ng-show="fbSleep.sleep[0]">{{(fbSleep.sleep[0].minutesAsleep/60 | number:2 )}} {{'fitbit.hours' | translate}} / {{fbSleep.sleep[0].minutesAwake }} min {{'fitbit.awake' | translate}} // {{(fbSleep.sleep[0].efficiency)}} % {{'fitbit.efficient' | translate}}</span></div>
<div><span class="fitbit-item" ng-show="fbSleep.sleep[0]">{{'fitbit.awake' | translate}}/{{'fitbit.restless' | translate}}: {{fbSleep.sleep[0].awakeCount}} / {{fbSleep.sleep[0].restlessCount}}</span></div>
<p></p>
<div><span class="fitbit-subtitle">{{'fitbit.deviceStatus' | translate}}</span></div>
<div class="" ng-repeat="device in fbDevices">
<div>
<span class="fitbit-item" ng-show="device.deviceVersion">{{device.deviceVersion}}</span><br>
<span class="fitbit-item" ng-show="device.battery">{{'fitbit.battery' | translate}}: {{device.battery}}<br>
<span class="fitbit-item" ng-show="device.lastSyncTime">{{'fitbit.synched' | translate}}: {{device.lastSyncTime | date: 'dd.MM.yyyy HH:mm:ss'}}</span>
</div>
</div>
<p></p>
<div><span class="fitbit-subtitle">{{'fitbit.latestBadges' | translate}}</span></div>
<div class="" ng-repeat="badge in fbDailyAverage.topBadges">
<div>
<span class="fitbit-item"><img class="fitbit-badge" ng-src="{{badge.image50px}}"/></span>
<span class="fitbit-item">{{badge.description}}</span>
</div>
</div>
</div>
<div class="playing-track">
<img ng-src="{{track.cover}}" />
<div>{{track.artist}}</div>
<div>{{track.title}}</div>
<div>{{track.album}}</div>
<div class="nowplaying" ng-show="track.playing">Playing</div>
</div>
</div>
<div class="bottom-right">
<!-- Someday something will live here -->
</div>
<div class="colors animate-grow" ng-show="focus == 'colors'">
<div class="color-block" ng-repeat="color in colors" style="background-color:{{color}}"></div>
</div>
</div>
<!-- Sleep cover -->
<div ng-show="focus == 'sleep'" class="sleep-cover fade"></div>
</body>
</html>