Skip to content

Instantly share code, notes, and snippets.

@jimjeffers
Created July 8, 2011 22:36
Show Gist options
  • Select an option

  • Save jimjeffers/1072988 to your computer and use it in GitHub Desktop.

Select an option

Save jimjeffers/1072988 to your computer and use it in GitHub Desktop.
HotSauce
var hotSauce = new Sauce();
hotSauce.addFlavor("chili",{
equation: Easie.elasticOut,
from: -400,
to: 0,
period: 15
}).addFlavor("pepper",{
equation: Easie.circOut,
from: 0.5,
to: 1,
endFrame: 75
});
hotSauce.spoon = function(flavors,browser) {
var css;
css = "-"+browser+"-transform: translate3d(0px,"+flavors.chili.value+"px,0) ";
css += "scale3d("+flavors.pepper.value+","+flavors.pepper.value+",0);";
return css;
}
hotSauce.applyTo("test",2).onComplete(function(element,flavors,browser) {
var css;
css = "translate3d(0px,"+flavors.chili.value+"px,0) ";
css += "scale3d("+flavors.pepper.value+","+flavors.pepper.value+",0)";
element.style.webkitTransform = css;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment