mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-07-04 11:44:27 +02:00
animation work
This commit is contained in:
parent
2ba6065a0d
commit
880e1ca630
5 changed files with 82 additions and 47 deletions
|
@ -41,6 +41,18 @@ var makeCommitBirthAnimation = function(gitVisuals, visNode) {
|
|||
};
|
||||
};
|
||||
|
||||
var makeHighlightAnimation = function(visNode, visBranch) {
|
||||
var fullTime = GRAPHICS.defaultAnimationTime * 0.66;
|
||||
var slowTime = fullTime * 2.0;
|
||||
|
||||
return {
|
||||
animation: function() {
|
||||
visNode.highlightTo(visBranch, slowTime, 'easeInOut');
|
||||
},
|
||||
duration: fullTime * 1.5
|
||||
};
|
||||
};
|
||||
|
||||
AnimationFactory.prototype.genCommitBirthAnimation = function(animationQueue, commit, gitVisuals) {
|
||||
if (!animationQueue) {
|
||||
throw new Error("Need animation queue to add closure to!");
|
||||
|
@ -143,9 +155,6 @@ AnimationFactory.prototype.rebaseAnimation = function(animationQueue, rebaseResp
|
|||
};
|
||||
|
||||
AnimationFactory.prototype.rebaseHighlightPart = function(animationQueue, rebaseResponse, gitEngine) {
|
||||
var fullTime = GRAPHICS.defaultAnimationTime * 0.66;
|
||||
var slowTime = fullTime * 2.0;
|
||||
|
||||
// we want to highlight all the old commits
|
||||
var oldCommits = rebaseResponse.toRebaseArray;
|
||||
// we are either highlighting to a visBranch or a visNode
|
||||
|
@ -157,18 +166,27 @@ AnimationFactory.prototype.rebaseHighlightPart = function(animationQueue, rebase
|
|||
|
||||
_.each(oldCommits, function(oldCommit) {
|
||||
var visNode = oldCommit.get('visNode');
|
||||
var anPack = makeHighlightAnimation(visNode, visBranch);
|
||||
animationQueue.add(new Animation({
|
||||
closure: function() {
|
||||
visNode.highlightTo(visBranch, slowTime, 'easeInOut');
|
||||
},
|
||||
duration: fullTime * 1.5
|
||||
closure: anPack.animation,
|
||||
duration: anPack.duration
|
||||
}));
|
||||
|
||||
}, this);
|
||||
|
||||
this.delay(animationQueue, fullTime * 2);
|
||||
};
|
||||
|
||||
AnimationFactory.prototype.genHighlightPromiseAnmation = function(commit, destBranch) {
|
||||
var visBranch = destBranch.get('visBranch');
|
||||
var visNode = commit.get('visNode');
|
||||
|
||||
var anPack = makeHighlightAnimation(visNode, visBranch);
|
||||
return new PromiseAnimation({
|
||||
closure: anPack.animation,
|
||||
duration: anPack.duration
|
||||
});
|
||||
};
|
||||
|
||||
AnimationFactory.prototype.rebaseBirthPart = function(animationQueue, rebaseResponse,
|
||||
gitEngine, gitVisuals) {
|
||||
var rebaseSteps = rebaseResponse.rebaseSteps;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue