flymis/WebRoot/dojojs/src/lfx/Animation.js
(开头部分) 15KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/*
Copyright (c) 2004-2006, The Dojo Foundation
All Rights Reserved.
Licensed under the Academic Free License version 2.1 or above OR the
modified BSD license. For more information on Dojo licensing, see:
http://dojotoolkit.org/community/licensing.shtml
*/
dojo.provide("dojo.lfx.Animation");
dojo.require("dojo.lang.func");
/*
Animation package based on Dan Pupius' work: http://pupius.co.uk/js/Toolkit.Drawing.js
*/
dojo.lfx.Line = function(/*int*/ start, /*int*/ end){
// summary: dojo.lfx.Line is the object used to generate values
// from a start value to an end value
this.start = start;
this.end = end;
if(dojo.lang.isArray(start)){
/* start: Array
end: Array
pId: a */
var diff = [];
dojo.lang.forEach(this.start, function(s,i){
diff[i] = this.end[i] - s;
}, this);
this.getValue = function(/*float*/ n){
var res = [];
dojo.lang.forEach(this.start, function(s, i){
res[i] = (diff[i] * n) + s;
}, this);
return res; // Array
}
}else{
var diff = end - start;
this.getValue = function(/*float*/ n){
// summary: returns the point on the line
// n: a floating point number greater than 0 and less than 1
return (diff * n) + this.start; // Decimal
}
}
}
dojo.lfx.easeDefault = function(/*Decimal?*/ n){
// summary: Returns the point for point n on a sin wave.
if(dojo.render.html.khtml){
// the cool kids are obviously not using konqueror...
// found a very wierd bug in floats constants, 1.5 evals as 1
// seems somebody mixed up ints and floats in 3.5.4 ??
// FIXME: investigate more and post a KDE bug (Fredrik)
return (parseFloat("0.5")+((Math.sin( (n+parseFloat("1.5")) * Math.PI))/2));
}else{
return (0.5+((Math.sin( (n+1.5) * Math.PI))/2));
}
后面还有 515 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。