user1857711
user1857711

Reputation: 117

how to do loops, and callbacks using $timeline?

Are these functionalities built into the service somewhere? Here's sample context:

HTML

<fa-modifier fa-opacity="opacityMod(testTimeline.get())">...

JS

$scope.testTimeline = new Transitionable(0);
$scope.opacityMod = $testTimeline([
    [0, 0, Easing.inOutExpo],
    [1, 1]
]);
$scope.testTimeline.set(1, {
    duration: 500,
    curver: 'easeInOut'
});

Couldn't find these in the docs or from reading src. The only ideas I had were:

Upvotes: 0

Views: 69

Answers (1)

user1857711
user1857711

Reputation: 117

Ended up just doing the callback on the transitionable's 'set' and re-running the function afterwards. Here's a sample:

function runLoop(){
    $scope.testTimeline.set(1, {duration:...,curve:...}, function() {
        $scope.testTimeline.set(0, {duration:....,curve....}, runLoop);
    });
}
runLoop();

Note that this runs the loop again but backwards. (I wanted this affect). Still open to other solutions

Upvotes: 0

Related Questions