Edit in JSFiddle

var _width = 800;
var _height = 400;
var _anim_duration = '120s';

var bonsaielement = bonsai.run(document.getElementById('movie'), {
    code: function () {
        var logo = new Group().addTo(stage);
        var triangles = [];

        // function randomRotation()
        // {
        //     (Math.random - 0.5) * 2;
        // }

        var _width = 800;
        var _height = 300;
        var _anim_duration = '120s';
        var _rotation_vec_divisor = 300;
		var _motion_vec_divisor = 4;
        var _reset_delay_stepper = 50;
        var _start_delay_seconds = 1;
        var _update_interval = 50;
        triangles[0] = {
            poly: new Polygon(100, 100, 80, 3)
                .addTo(logo)
                .attr('fillColor', '#ff7500')
                .on('pointermove', function (e) {
                reset(triangles[0]);
            }).on('multi:pointerdown', function (e) {
                reset(triangles[0]);
            }),
            homepos: [100, 100],
            homerot: 0,
            idealrot: 0,
            animvector: [((Math.random() - 0.5) / _motion_vec_divisor), ((Math.random() - 0.5) / _motion_vec_divisor), ((Math.random() - 0.5) / _rotation_vec_divisor)],
            stopped: false,
            stoptriggered: false,
            stoptimer: 0
        };
        triangles[1] = {
            poly: new Polygon(130, 60, 80, 3)
                .addTo(logo)
                .attr('fillColor', '#ff7500')
                .attr('rotation', Math.PI)
                .on('pointermove', function (e) {
                reset(triangles[1]);
            }).on('multi:pointerdown', function (e) {
                reset(triangles[1]);
            }),
            homepos: [130, 60],
            homerot: Math.PI,
            idealrot: 0,
            animvector: [((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5) / _rotation_vec_divisor)],
            stopped: false,
            stoptriggered: false,
            stoptimer: 0
        };
        triangles[2] = {
            poly: new Polygon(270, 60, 80, 3)
                .addTo(logo)
                .attr('fillColor', '#ff7500')
                .attr('rotation', Math.PI)
                .on('pointermove', function (e) {
                reset(triangles[2]);
                }).on('multi:pointerdown', function (e) {
                reset(triangles[2]);
            }),
            homepos: [270, 60],
            homerot: Math.PI,
            idealrot: 0,
            animvector: [((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5) / _rotation_vec_divisor)],
            stopped: false,
            stoptriggered: false,
            stoptimer: 0
        };
        triangles[3] = {
            poly: new Polygon(320, 60, 80, 3)
                .addTo(logo)
                .attr('fillColor', '#ff7500')
                .attr('rotation', Math.PI)
                .on('pointermove', function (e) {
                reset(triangles[3]);
            }).on('multi:pointerdown', function (e) {
                reset(triangles[3]);
            }),
            homepos: [320, 60],
            homerot: Math.PI,
            idealrot: 0,
            animvector: [((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5)) / _motion_vec_divisor, ((Math.random() - 0.5) / _rotation_vec_divisor)],
            stopped: false,
            stoptriggered: false,
            stoptimer: 0
        };

        logo.attr('opacity', 0.0)
            .animate('1s', {
            opacity: 1.0
        });
        logo.attr('x', (_width / 2) - 200).attr('y', (_height / 2) - 80);

        var t = stage.children();
        
        function updatetris() {
            for (var i = 0, tri;
            (tri = triangles[i++]);) {
                if(!tri.stopped && tri.stoptimer <= 0) {
                    tri.poly.attr('x', tri.poly.attr('x') + tri.animvector[0]);
                    tri.poly.attr('y', tri.poly.attr('y') + tri.animvector[1]);
                    tri.poly.attr('rotation', tri.poly.attr('rotation') + tri.animvector[2]);
                    tri.idealrot += tri.animvector[2];
                } else if(tri.stoptimer == 1) {
                    tri.stoptimer = 0;
                    tri.stopped = false;
                    tri.stoptriggered = false;
                }
                else if(tri.stoptimer > 0) {
                    tri.stoptimer--;
                }
            }
        }

        function reset(tri) {
            // tri.poly.stop();
            if(!tri.stoptriggered) {
                if(tri.poly.attr('rotation') != tri.homerot + tri.idealrot)
                {
                    tri.poly.attr('rotation', tri.homerot + tri.idealrot);
                }
                tri.poly.animate('1s', {
                    x: tri.homepos[0],
                    y: tri.homepos[1],
                    rotation: tri.homerot
                }, {
                    easing: 'elasticOut',
                    delay: '0s'
                });
                tri.stopped = true;
                tri.stoptriggered = true;
                tri.stoptimer = _reset_delay_stepper;
                tri.animvector = [((Math.random() - 0.5) / _motion_vec_divisor), ((Math.random() - 0.5) / _motion_vec_divisor), ((Math.random() - 0.5) / _rotation_vec_divisor)];
            }           
        }
		
        setTimeout(function() { setInterval(updatetris, _update_interval); }, _start_delay_seconds * 1000);

    },
    width: _width,
    height: _height

});
<div id="movie"></div>
html {
    background-color: white;
}
#movie {
    position: absolute;
    width: 800px;
    left: 50%;
    margin-left: -400px;
}