Increase moon opacity to 0.6 when below horizon
This commit is contained in:
1 parent
c91a278294
commit
093ca2b2b7
1 file changed
+6
-3
+6
-3
@@ -540,15 +540,18 @@
|
||||
// Moon position - interpolated between moonrise and moonset on the orbit
|
||||
var moonPos = getMoonPosition(now, moonTimes);
|
||||
if (!moonPos || !moonPos.point || isNaN(moonPos.point.x) || isNaN(moonPos.point.y)) {
|
||||
// Fallback to current time position
|
||||
var fallbackP = pointOnCircle(now, MOON_ORBIT_RADIUS);
|
||||
rpgMoon.setAttribute('transform', 'translate(' + fallbackP.x + ', ' + fallbackP.y + ')');
|
||||
rpgMoon.setAttribute('opacity', '0.35');
|
||||
rpgMoon.setAttribute('opacity', '0.6');
|
||||
} else {
|
||||
rpgMoon.setAttribute('transform', 'translate(' + moonPos.point.x + ', ' + moonPos.point.y + ')');
|
||||
rpgMoon.setAttribute('opacity', moonPos.isVisible ? '1' : '0.35');
|
||||
rpgMoon.setAttribute('opacity', moonPos.isVisible ? '1' : '0.6');
|
||||
}
|
||||
|
||||
// TEMP DEBUG: show moon at center
|
||||
// rpgMoon.setAttribute('transform', 'translate(100, 100)');
|
||||
// rpgMoon.setAttribute('opacity', '1');
|
||||
|
||||
// Sun rise/set arrows
|
||||
var srP = pointOnCircle(sunTimes.sunrise, SUN_ORBIT_RADIUS);
|
||||
sunRiseArrow.setAttribute('transform', 'translate(' + srP.x + ', ' + srP.y + ')');
|
||||
|
||||
Reference in new issue
Block a user