Unified lifecycle manager for the three canonical corruption patterns — src/core/corruption-manager.js
Character-by-character corruption → readable text
Rapid phrase cycling — unstable signal simulation
Flicker phase → decode phase (maximum chaos)
import { CorruptionManager } from 'src/core/corruption-manager.js';
const mgr = new CorruptionManager({ nsfw: false });
// Pattern 1 — character decode
mgr.decode(element, 'SYSTEM ONLINE', { duration: 2000 });
// Pattern 2 — phrase flicker
mgr.flicker(element, ['LOADING...', 'CALIBRATING...', 'STANDBY...'], {
duration: 3000,
finalText: 'READY',
});
// Pattern 3 — hybrid (flicker then decode)
mgr.hybrid(element, ['CORRUPTING...', 'REWRITING...'], 'REALITY RESTORED', {
duration: 4000,
});
mgr.stop(); // cancel all running animations
mgr.destroy(); // full teardown (visibilitychange listener removed)