JavaScript fractal generator