Restart day simulation, update debug for clouds2 keys
This commit is contained in:
1 parent
854367be82
commit
0ed8240d3b
1 file changed
+22
-12
+22
-12
@@ -952,39 +952,49 @@ var weatherThemes = {
|
|||||||
|
|
||||||
var themeColors = getEffectiveThemeColors();
|
var themeColors = getEffectiveThemeColors();
|
||||||
if (themeColors) {
|
if (themeColors) {
|
||||||
var keys = ['skyColor', 'cloudColor', 'cloudShadowColor', 'sunColor', 'sunGlareColor', 'sunlightColor', 'backgroundColor'];
|
var keys = ['skyColor', 'cloudColor', 'lightColor', 'backgroundColor'];
|
||||||
var keyMap = {skyColor: 'sky', cloudColor: 'cloud', cloudShadowColor: 'cloudShadow', sunColor: 'sun', sunGlareColor: 'sunGlare', sunlightColor: 'sunLight', backgroundColor: 'bg'};
|
var keyMap = {skyColor: 'sky', cloudColor: 'cloud', lightColor: 'sunLight', backgroundColor: 'bg'};
|
||||||
for (var i = 0; i < keys.length; i++) {
|
for (var i = 0; i < keys.length; i++) {
|
||||||
var k = keys[i];
|
var k = keys[i];
|
||||||
var kk = keyMap[k];
|
var kk = keyMap[k];
|
||||||
var c = themeColors[k];
|
var c = themeColors[k];
|
||||||
document.getElementById('dbg-t-' + kk).style.backgroundColor = '#' + ('00000' + c.toString(16)).slice(-6);
|
if (kk === 'sunLight') {
|
||||||
document.getElementById('dbg-h-' + kk).textContent = '#' + ('00000' + c.toString(16)).slice(-6);
|
document.getElementById('dbg-t-sunLight').style.backgroundColor = '#' + ('00000' + c.toString(16)).slice(-6);
|
||||||
|
document.getElementById('dbg-h-sunLight').textContent = '#' + ('00000' + c.toString(16)).slice(-6);
|
||||||
|
} else {
|
||||||
|
document.getElementById('dbg-t-' + kk).style.backgroundColor = '#' + ('00000' + c.toString(16)).slice(-6);
|
||||||
|
document.getElementById('dbg-h-' + kk).textContent = '#' + ('00000' + c.toString(16)).slice(-6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vantaColors) {
|
if (vantaColors) {
|
||||||
var vKeys = ['sky', 'cloud', 'cloudShadow', 'sun', 'sunGlare', 'sunLight', 'bg'];
|
var vKeys = ['sky', 'cloud', 'light', 'bg'];
|
||||||
|
var vKeyMap = {sky: 'sky', cloud: 'cloud', light: 'sunLight', bg: 'bg'};
|
||||||
for (var j = 0; j < vKeys.length; j++) {
|
for (var j = 0; j < vKeys.length; j++) {
|
||||||
var vk = vKeys[j];
|
var vk = vKeys[j];
|
||||||
var vc = vantaColors[vk];
|
var vc = vantaColors[vk];
|
||||||
document.getElementById('dbg-v-' + vk).style.backgroundColor = '#' + ('00000' + vc.toString(16)).slice(-6);
|
var kk = vKeyMap[vk];
|
||||||
document.getElementById('dbg-vh-' + vk).textContent = '#' + ('00000' + vc.toString(16)).slice(-6);
|
if (kk === 'sunLight') {
|
||||||
|
document.getElementById('dbg-v-sunLight').style.backgroundColor = '#' + ('00000' + vc.toString(16)).slice(-6);
|
||||||
|
document.getElementById('dbg-vh-sunLight').textContent = '#' + ('00000' + vc.toString(16)).slice(-6);
|
||||||
|
} else {
|
||||||
|
document.getElementById('dbg-v-' + kk).style.backgroundColor = '#' + ('00000' + vc.toString(16)).slice(-6);
|
||||||
|
document.getElementById('dbg-vh-' + kk).textContent = '#' + ('00000' + vc.toString(16)).slice(-6);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function animate() {
|
function animate() {
|
||||||
var t = getCurrentDayProgress();
|
var elapsed = (Date.now() - startTime) % CYCLE;
|
||||||
|
var t = elapsed / CYCLE;
|
||||||
var c = getColor(t);
|
var c = getColor(t);
|
||||||
c = applyWeatherTheme(c);
|
c = applyWeatherTheme(c);
|
||||||
effect.setOptions({
|
effect.setOptions({
|
||||||
skyColor: c.sky,
|
skyColor: c.sky,
|
||||||
cloudColor: c.cloud,
|
cloudColor: c.cloud,
|
||||||
cloudShadowColor: c.cloudShadow,
|
lightColor: c.light,
|
||||||
sunColor: c.sun,
|
|
||||||
sunGlareColor: c.sunGlare,
|
|
||||||
sunlightColor: c.sunLight,
|
|
||||||
backgroundColor: c.bg,
|
backgroundColor: c.bg,
|
||||||
speed: currentThemeSpeed
|
speed: currentThemeSpeed
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user