clock: add background to moon

This commit is contained in:
Tyler Brown Cifu Shuster 2020-10-27 17:02:22 -07:00
parent 0920b83f2d
commit a823913b8c

View File

@ -72,10 +72,19 @@ const Moon = ({ angle, ...props }) => {
<rect x="-50" y="-50" height="200" width="200" fill="black" />
<path d={dFromPhase(phase)} fill="white"/>
</mask>
<circle
id="moonbg"
cx={CX + (RADIUS - 12) * Math.cos(degToRad(angle))}
cy={CY + (RADIUS - 12) * Math.sin(degToRad(angle))}
fill="rgba(255,255,255,0.6)"
r={CELESTIAL_BODY_SIZE / 2}
{...props}
></circle>
<use
width={CELESTIAL_BODY_SIZE}
height={CELESTIAL_BODY_SIZE}
xlinkHref="#Moon-symbol"
id="moon"
x={cx}
y={cy}
transform={`rotate(${angle} ${cx + (CELESTIAL_BODY_SIZE / 2)} ${cy + (CELESTIAL_BODY_SIZE / 2)})`}