Usage & API
🚀 Translux Usage
Section titled “🚀 Translux Usage”Bring the power of Translux and its FSM to your frontend stack.
Translux.apply()
Section titled “Translux.apply()”The simplest way to use Translux without a framework adapter is to query your container elements and instantiate the engine.
import { Translux } from 'translux/core';
document.addEventListener('DOMContentLoaded', () => { Translux.apply('.glass-panel', { blurRadius: 12, saturation: 150 });});Because Translux uses nested selectors and relies on physical interaction properties pointer-events, you should avoid placing Translux boundaries deeply inside pseudo-elements.
Translux.compute()
Section titled “Translux.compute()”You can query the math and physics directly without mutating the DOM, retrieving the diffuse glow arrays.
const glowValues = Translux.compute({ lightDistance: 4, exponent: 1.2 });element.style.boxShadow = glowValues.join(', ');