var size = 6, // Change size s = Snap('#s'), tny = size * 4, sml = size * 8, med = sml * 2, lrg = med * 2, xxl = lrg * 2, style = function (size) { return s.circle(size, size, size).attr({ // xxl = 64 fill: 'hsla(' + (360 / 64 * size) + ',' + (100 / 64 * size) + ',' + (100 / 64 * size) + ',0.6)' }).pattern(0, 0, size * 3, size * 3); }, surface = function (size) { return s.rect(-4000, -4000, 8000, 8000).attr({ fill: style(size) }); }, infRotate = function (surface, size) { var pos = size * size / (size / 2); surface.transform('r0,' + pos + ',' + pos); surface.animate({ transform: 'r360,' + pos + ',' + pos }, xxl * 50, mina.linear, infRotate.bind(this, surface, size)); }; // Too much CPU ahh! //infRotate(surface(tny), tny); infRotate(surface(sml), sml); infRotate(surface(med), med); infRotate(surface(lrg), lrg); infRotate(surface(xxl), xxl);