How mmnga/x-ambient works
X Ambient is a Chrome extension that lights the page from media in a hovered X post. Its main workflow is to find visible post media, render its edge colors into a blurred ambient field, and apply a mask so the original media stays sharp; settings control the effect. The graph also includes optional card fitting and the settings popup. The excerpts show these runtime links, but do not expose all of content.js or the extension manifest, so uncertain wiring is omitted.
Main entry points: content.js Post interaction · card-layout.js Window-fit cards · popup.js Settings popup · settings.js Settings model
Components 10
Page interaction
- Post interaction
src/content.js - Media discovery
src/content.js
Ambient rendering
- Light renderer
src/content.js - Geometry and projection
src/ambient-core.js
Settings
- Settings model
src/settings.js - Settings popup
src/popup.js - Local settings
Card layout
- Window-fit cards
src/card-layout.js
Other components
- X user
- X timeline
Connections 15
- X user → X timeline: hovers over
README.md - X timeline → Post interaction: provides page media
README.md - Post interaction → Media discovery: finds visible media
src/content.js - Media discovery → Light renderer: supplies sources
src/content.js - Post interaction → Light renderer: updates effect
src/content.js - Light renderer → Geometry and projection: uses geometry
src/content.js - Light renderer → X timeline: draws ambient light
README.md - Light renderer → X timeline: masks original media
src/content.js - Settings popup → Settings model: normalizes values
src/popup.js - Settings popup → Local settings: reads and saves
src/popup.js - Local settings → Post interaction: provides preferences
README.md - Post interaction → Settings model: applies preferences
src/content.js - Post interaction → Window-fit cards: creates layout
- Window-fit cards → X timeline: fits cards
README.md - Window-fit cards → Post interaction: signals layout changes
src/card-layout.js