Project

General

Profile

Statistics
| Revision:

root / trunk / web / dojo / dojox / css3 / fx.js @ 10

History | View | Annotate | Download (2.62 KB)

1 9 andrej.cim
/*
2
        Copyright (c) 2004-2010, The Dojo Foundation All Rights Reserved.
3
        Available via Academic Free License >= 2.1 OR the modified BSD license.
4
        see: http://dojotoolkit.org/license for details
5
*/
6
7
8
if(!dojo._hasResource["dojox.css3.fx"]){
9
dojo._hasResource["dojox.css3.fx"]=true;
10
dojo.provide("dojox.css3.fx");
11
dojo.require("dojo.fx");
12
dojo.require("dojox.html.ext-dojo.style");
13
dojo.require("dojox.fx.ext-dojo.complex");
14
dojo.mixin(dojox.css3.fx,{puff:function(_1){
15
return dojo.fx.combine([dojo.fadeOut(_1),this.expand({node:_1.node,endScale:_1.endScale||2})]);
16
},expand:function(_2){
17
return dojo.animateProperty({node:_2.node,properties:{transform:{start:"scale(1)",end:"scale("+[_2.endScale||3]+")"}}});
18
},shrink:function(_3){
19
return this.expand({node:_3.node,endScale:0.01});
20
},rotate:function(_4){
21
return dojo.animateProperty({node:_4.node,duration:_4.duration||1000,properties:{transform:{start:"rotate("+(_4.startAngle||"0deg")+")",end:"rotate("+(_4.endAngle||"360deg")+")"}}});
22
},flip:function(_5){
23
var _6=[],_7=_5.whichAnims||[0,1,2,3],_8=_5.direction||1,_9=[{start:"scale(1, 1) skew(0deg,0deg)",end:"scale(0, 1) skew(0,"+(_8*30)+"deg)"},{start:"scale(0, 1) skew(0deg,"+(_8*30)+"deg)",end:"scale(-1, 1) skew(0deg,0deg)"},{start:"scale(-1, 1) skew(0deg,0deg)",end:"scale(0, 1) skew(0deg,"+(-_8*30)+"deg)"},{start:"scale(0, 1) skew(0deg,"+(-_8*30)+"deg)",end:"scale(1, 1) skew(0deg,0deg)"}];
24
for(var i=0;i<_7.length;i++){
25
_6.push(dojo.animateProperty(dojo.mixin({node:_5.node,duration:_5.duration||600,properties:{transform:_9[_7[i]]}},_5)));
26
}
27
return dojo.fx.chain(_6);
28
},bounce:function(_a){
29
var _b=[],n=_a.node,_c=_a.duration||1000,_d=_a.scaleX||1.2,_e=_a.scaleY||0.6,ds=dojo.style,_f=ds(n,"position"),_10="absolute",_11=ds(n,"top"),_12=[],_13=0,_14=Math.round,_15=_a.jumpHeight||70;
30
if(_f!=="absolute"){
31
_10="relative";
32
}
33
var a1=dojo.animateProperty({node:n,duration:_c/6,properties:{transform:{start:"scale(1, 1)",end:"scale("+_d+", "+_e+")"}}});
34
dojo.connect(a1,"onBegin",function(){
35
ds(n,{transformOrigin:"50% 100%",position:_10});
36
});
37
_b.push(a1);
38
var a2=dojo.animateProperty({node:n,duration:_c/6,properties:{transform:{end:"scale(1, 1)",start:"scale("+_d+", "+_e+")"}}});
39
_12.push(a2);
40
_12.push(new dojo.Animation(dojo.mixin({curve:[],duration:_c/3,delay:_c/12,onBegin:function(){
41
_13=(new Date).getTime();
42
},onAnimate:function(){
43
var _16=(new Date).getTime();
44
ds(n,{top:parseInt(ds(n,"top"))-_14(_15*((_16-_13)/this.duration))+"px"});
45
_13=_16;
46
}},_a)));
47
_b.push(dojo.fx.combine(_12));
48
_b.push(dojo.animateProperty(dojo.mixin({duration:_c/3,onEnd:function(){
49
ds(n,{position:_f});
50
},properties:{top:_11}},_a)));
51
_b.push(a1);
52
_b.push(a2);
53
return dojo.fx.chain(_b);
54
}});
55
}