Use real time for day progression instead of 20s simulated cycle
This commit is contained in:
1 parent
33d6635b24
commit
cf9590b2ed
1 file changed
+7
-2
+7
-2
@@ -863,9 +863,14 @@ var weatherThemes = {
|
||||
};
|
||||
}
|
||||
|
||||
function getCurrentDayProgress() {
|
||||
var now = new Date();
|
||||
var startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 0, 0, 0);
|
||||
return (now.getTime() - startOfDay.getTime()) / 86400000;
|
||||
}
|
||||
|
||||
function animate() {
|
||||
var elapsed = (Date.now() - startTime) % CYCLE;
|
||||
var t = elapsed / CYCLE;
|
||||
var t = getCurrentDayProgress();
|
||||
var c = getColor(t);
|
||||
c = applyWeatherTheme(c);
|
||||
effect.setOptions({
|
||||
|
||||
Reference in new issue
Block a user