A WebGL-powered generative visual library for creating beautiful, animated plasma clouds.
<script src="https://aura.lightward.io/aura.js"></script>
<script>
const container = document.getElementById('my-container');
const canvas = document.createElement('canvas');
container.appendChild(canvas);
const gl = canvas.getContext('webgl2', { preserveDrawingBuffer: true });
const aura = new LightwardAura(gl, {
...LightwardAura.defaultParams,
width: window.innerWidth,
height: window.innerHeight,
});
aura.start();
</script>const aura = new LightwardAura(gl, {
...LightwardAura.defaultParams,
width: window.innerWidth,
height: window.innerHeight,
colors: [
[100, 150, 255], // RGB values 0-255
[255, 100, 150],
],
});gl: WebGL2 rendering contextparams: Configuration object (see below)
start(play = true)- Start the render loopplay()- Resume animationpause()- Pause animationshutdown()- Clean up resources
LightwardAura.defaultParams- Default configuration object (excludeswidthandheight)
{
width: number; // Canvas width
height: number; // Canvas height
animTime: number; // Initial animation time
seed: number; // Random seed for reproducibility
colors: [r, g, b][]; // Array of RGB color tuples (0-255)
globalParams: {
contrast: number; // Default: 1.37
saturation: number; // Default: 1.69
speed: number; // Default: 0.13
noise: number; // Default: 0.5
targetFps: number; // Default: 60
// ... (see defaultParams for full list)
};
// ... (see defaultParams for complete structure)
}npm install
npm run buildnpm run watchUse any static file server (like Live Server for VSCode) to view index.html during development.
npm testUNLICENSE - Public domain