import { addTo } from '../../addTo';
import { getGroup } from '../../getGroup';
import { getPrefab } from '../../getPrefab';
import { getSpinning } from '../../getSpinning';
import { rsd } from '../../utils/randomSeed';
export const squaresVortex = {
    onEach: (info) => {
        const spinDuration = 8;
        const wrapper = getGroup({ p: [0, 0, 0] });
        const getOffset = () => {
            return 0; // rsd(info.seed).range(-0.5, 0.5);
        };
        const size = 40;
        const size2 = 10;
        const wallWrapper = getGroup({ p: [0, -size2 - size * 0.5, 0], s: [1, 1, 4] });
        const material = rsd().randomFromArray([
            'palette_01_pink',
            'palette_01_green',
            'palette_01_red',
            'palette_01_cerulean',
            'palette_01_green',
            'palette_01_orange',
        ]);
        addTo(wallWrapper, getPrefab({ id: 'cube_01', p: [0 + getOffset(), -size2 + getOffset(), 0], s: [size, size2, 1], material }));
        addTo(wallWrapper, getPrefab({
            id: 'cube_01',
            p: [0 + getOffset(), size + size2 + size2 + getOffset(), 0],
            s: [size, size2, 1],
            material,
        }));
        addTo(wallWrapper, getPrefab({
            id: 'cube_01',
            p: [size + getOffset(), size - 2 + getOffset(), 0],
            r: [0, 0, 90],
            s: [size, size2, 1],
            material,
        }));
        addTo(wallWrapper, getPrefab({
            id: 'cube_01',
            p: [-size + getOffset(), size - 2 + getOffset(), 0],
            r: [0, 0, 90],
            s: [size, size2, 1],
            material,
        }));
        addTo(wrapper, wallWrapper);
        const res = getSpinning(wrapper, {
            axis: 'z',
            loopBehaviour: 'REVERSE',
            easing: 'EASE_IN_OUT_QUAD',
            direction: rsd(info.seed).randomFromArray([1, -1]),
            duration: spinDuration,
            progress: rsd(info.seed).getValue(),
        });
        return res;
    },
    depth: 10,
    repeats: 40,
    duration: 32,
};
//# sourceMappingURL=squaresVortex.js.map