Magick.ly is open-source. You can see the code used to generate this page in page.tsx, Moon.tsx and Mercury.tsx.
Image credit:Planet2013.svg from Wikimedia Commons, released under CC-BY-SA 2.5.