flymis/WebRoot/dojojs/src/animation/Animation.js
(开头部分) 7KB这里只显示每个文件的开头 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.animation.Animation");
dojo.require("dojo.animation.AnimationEvent");
dojo.require("dojo.lang.func");
dojo.require("dojo.math");
dojo.require("dojo.math.curves");
dojo.deprecated("dojo.animation.Animation is slated for removal in 0.5; use dojo.lfx.* instead.", "0.5");
/*
Animation package based off of Dan Pupius' work on Animations:
http://pupius.co.uk/js/Toolkit.Drawing.js
*/
dojo.animation.Animation = function(/*dojo.math.curves.* */ curve, /*int*/ duration, /*Decimal?*/ accel, /*int?*/ repeatCount, /*int?*/ rate) {
// summary: Animation object iterates a set of numbers over a curve for a given amount of time, calling 'onAnimate' at each step.
// curve: Curve to animate over.
// duration: Duration of the animation, in milliseconds.
// accel: Either an integer or curve representing amount of acceleration. (?) Default is linear acceleration.
// repeatCount: Number of times to repeat the animation. Default is 0.
// rate: Time between animation steps, in milliseconds. Default is 25.
// description: Calls the following events: "onBegin", "onAnimate", "onEnd", "onPlay", "onPause", "onStop"
// If the animation implements a "handler" function, that will be called before each event is called.
if(dojo.lang.isArray(curve)) {
// curve: Array
// id: i
curve = new dojo.math.curves.Line(curve[0], curve[1]);
}
this.curve = curve;
this.duration = duration;
this.repeatCount = repeatCount || 0;
this.rate = rate || 25;
if(accel) {
// accel: Decimal
// id: j
if(dojo.lang.isFunction(accel.getValue)) {
// accel: dojo.math.curves.CatmullRom
// id: k
this.accel = accel;
} else {
var i = 0.35*accel+0.5; // 0.15 <= i <= 0.85
this.accel = new dojo.math.curves.CatmullRom([[0], [i], [1]], 0.45);
}
}
}
dojo.lang.extend(dojo.animation.Animation, {
// public properties
curve: null,
后面还有 185 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。