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() {
|
function animate() {
|
||||||
var elapsed = (Date.now() - startTime) % CYCLE;
|
var t = getCurrentDayProgress();
|
||||||
var t = elapsed / CYCLE;
|
|
||||||
var c = getColor(t);
|
var c = getColor(t);
|
||||||
c = applyWeatherTheme(c);
|
c = applyWeatherTheme(c);
|
||||||
effect.setOptions({
|
effect.setOptions({
|
||||||
|
|||||||
Reference in new issue
Block a user