@egorfdrv/facegen
v0.1.0
Published
Generate unique animated faces from any string. Zero dependencies, deterministic, SVG + CSS animations.
Maintainers
Readme
facegen
Generate unique animated faces from any string. Zero dependencies, deterministic, SVG + CSS animations.
npm i facegenReact
import { Facegen } from 'facegen';
import 'facegen/css';
<Facegen seed="[email protected]" size={48} animate />Vanilla JS
import { generateFaceSvg } from 'facegen';
const svg = generateFaceSvg('[email protected]', { size: 48, animate: true });
document.getElementById('avatar').innerHTML = svg;Props
| Prop | Type | Default | Description |
|------|------|---------|-------------|
| seed | string | — | Any string. Determines the face. |
| size | number | 64 | Avatar size in px. Below 32px animations are disabled. |
| animate | boolean | true | Enable blink / float / twitch animations. |
| alt | string | "Avatar" | Accessible label (React only). |
How it works
- DJB2 hash of the seed string
- Slot-based parameter extraction (face shape, skin color, eyes, etc.)
- Pure SVG string generation — no canvas, no WebGL
- CSS keyframe animations with unique phase offsets
License
MIT
