Skip to content

Repository files navigation

MMM-MoonClear

A MagicMirror² module that shows a clean, comic-style moon phase with the current sunrise and sunset flanking the moon. No API key required — everything is computed locally with SunCalc.

MMM-MoonClear screenshot

Features

  • Accurate moon phase (illuminated fraction) rendered as an SVG with a soft shadow terminator
  • Localised phase name below the moon (English & German included; easy to add languages)
  • Sunrise (warm, ↑) on the left and sunset (cool, ↓) on the right of the moon, with times
  • Fully self-contained styling — no dependency on any global stylesheet
  • Everything configurable: location, size, clock format, what to show

Installation

cd ~/MagicMirror/modules
git clone https://github.com/ago1776/MMM-MoonClear
cd MMM-MoonClear
npm install

Then add the module to config/config.js:

{
  module: "MMM-MoonClear",
  position: "top_center",
  header: "Moon",            // optional MagicMirror header strip
  config: {
    lat: 52.520,
    lon: 13.405
  }
}

Configuration options

Option Type Default Description
lat number 52.520 Observer latitude (decimal degrees).
lon number 13.405 Observer longitude (decimal degrees).
showSunTimes boolean true Show sunrise (left) and sunset (right) beside the moon.
showPhaseName boolean true Show the localised phase name below the moon.
shortPhase boolean false Show just "Waxing"/"Waning" instead of the full phase name.
overlapSunTimes boolean false Let a large moon overlap the sun times (which stay legible).
timeFormat number 24 24 or 12 hour clock for the sun times.
moonSize number 84 Moon diameter in pixels.
moonPack string null Bring your own moon art — see below.
updateInterval number 1800000 (30 min) How often the phase/sun times are recomputed (ms).

Custom moon art

The bundled SVG moon needs nothing. To use your own images instead, point moonPack at a folder of 8 PNGs (module-relative path, absolute path, or URL) with these basenames:

new  waxing_crescent  first_quarter  waxing_gibbous  full  waning_gibbous  last_quarter  waning_crescent

Pair it with a larger moonSize and overlapSunTimes: true for a bold "hero moon" look.

⚠️ Licensing is on you. Only use image sets you're allowed to distribute. Some gorgeous moon sets are non-commercial — fine for a private mirror, not for a public/commercial release. The bundled SVG moon is MIT and safe everywhere.

Translations

Phase names live in translations/en.json and translations/de.json. To add a language, copy en.json to <lang>.json, translate the values, and add the file to getTranslations() in MMM-MoonClear.js. Language follows MagicMirror's global language setting.

Dependencies

  • suncalc (installed via npm install)

License

MIT © Andreas Göpfert

About

MagicMirror² module: clean comic moon phase with sunrise/sunset flanking the moon (SunCalc, no API key).

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages