A MagicMirror² module that displays a Matrix-style digital rain animation as a fullscreen background.
- Fullscreen falling code animation behind all other modules
- Supports rotated displays (portrait mode)
- Adjustable brightness so overlaid modules remain readable
- Customizable colors, speed, density, and character sets
- Optional Matrix Code NFI font for authentic look
cd ~/MagicMirror/modules
git clone https://github.com/syntosys-101/MMM-MatrixRain.git- Download from: https://www.dafont.com/matrix-code-nfi.font
- Extract and copy the font file:
mkdir -p ~/MagicMirror/modules/MMM-MatrixRain/fonts
cp "matrix code nfi.ttf" ~/MagicMirror/modules/MMM-MatrixRain/fonts/Add this to your modules array in config/config.js:
{
module: "MMM-MatrixRain",
position: "fullscreen_below"
}All options are optional with sensible defaults:
| Option | Description | Default |
|---|---|---|
fontSize |
Character size in pixels | 20 |
color |
Rain color (hex) | "#00ff00" |
speed |
Milliseconds between frames (lower = faster) | 50 |
density |
How often new drops spawn (0.90–0.99) | 0.96 |
trailLength |
Fade speed (0.02–0.1, lower = longer trails) | 0.05 |
brightness |
Character brightness (0.1–1.0) | 0.4 |
rotated |
Set to true if display is rotated 90° |
false |
width |
Manual width override in pixels | null (auto) |
height |
Manual height override in pixels | null (auto) |
useMatrixFont |
Use Matrix Code NFI font | true |
charset |
Characters to display | Katakana + alphanumeric |
{
module: "MMM-MatrixRain",
position: "fullscreen_below",
config: {
fontSize: 22,
color: "#00ff00",
speed: 45,
density: 0.97,
brightness: 0.3
}
}Subtle Background
config: {
brightness: 0.2,
speed: 70,
density: 0.94
}Intense Rain
config: {
brightness: 0.6,
speed: 35,
density: 0.98
}Cyberpunk Blue
config: {
color: "#00ffff",
brightness: 0.4
}Binary Only
config: {
charset: "01",
useMatrixFont: false
}If your MagicMirror is in portrait mode using CSS rotation like:
body {
transform: rotate(-90deg);
transform-origin: top left;
width: 100vh;
height: 100vw;
top: 100vh;
}Set rotated: true in your config:
{
module: "MMM-MatrixRain",
position: "fullscreen_below",
config: {
rotated: true,
brightness: 0.3
}
}If auto-detection doesn't work, set dimensions manually (swap your screen's width/height):
{
module: "MMM-MatrixRain",
position: "fullscreen_below",
config: {
width: 1080, // Your screen's height becomes width when rotated
height: 1920, // Your screen's width becomes height when rotated
brightness: 0.3
}
}Font not showing
- Ensure
matrix code nfi.ttfis in thefonts/folder - Check file permissions:
chmod 644 fonts/matrix\ code\ nfi.ttf - Set
useMatrixFont: falseto use system monospace as fallback
Animation is choppy
- Increase
speedvalue (e.g., 70 or 80) - Decrease
fontSizeto reduce number of columns
Rain not covering full screen
- Check
rotatedsetting matches your display orientation - Use manual
widthandheightoverrides with your screen resolution - Check browser console for "MMM-MatrixRain canvas size" log message
Overlaid modules hard to read
- Decrease
brightness(try 0.2 or 0.15)
MIT License - Feel free to modify and share!
- Matrix Code NFI font by Norfok Incredible Font Design
- Inspired by The Matrix trilogy
