I don't get any error with your code, however the tranformation does not happen as wished because the triangle has only 3 points.
I fixed it with
var tpts = [100,100,100,100,100,130,120,115];
try this
var paper = Snap('svg');
var tpts = [100,100,100,100,100,130,120,115];
var sqpts = [100,100,100,130,130,130,130,100];
var tri = paper.polygon(tpts);
tri.attr({
id:"tri",
fill:"#555555"
});
sqrFunc = function(){
tri.animate({"points":sqpts},1000,mina.linear);
}
triFunc = function(){
tri.animate({"points":tpts},1000,mina.linear);
}
setTimeout(sqrFunc, 200);
setTimeout(triFunc, 1200);
another method is to use paths
var paper = Snap('svg');
var tri = paper.path("M 10 10, L 10 50, L 50 25, Z");
tri.attr({
id:"tri",
fill:"#555555"
});
sqrFunc = function(){
tri.animate({d:"M 10 10, L 10 50, L 50 50, L50 10,Z"},1000,mina.linear);
}
triFunc = function(){
tri.animate({d:"M 10 10, L 10 50, L 50 25, Z"},1000,mina.linear);
}
setTimeout(sqrFunc, 200);
setTimeout(triFunc, 1200);