-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
deferred proposal #39
Comments
Nice! I like the simplicity of the first one, but perhaps a new method would help us create and re-use the sequences later? Being able to stop / start them seems rather useful. Here's some code for thought: var seq1 = morepheus.series(other, {});
var seq2 = morepheus.series(el, {
opacity: 1,
complete: function () {} // first part completed, do something optional
})
.then({
left: '+=50',
start: seq1.start, // sequence 1 should start here
update: function (p) {} // second part updated and the position is 0-1
})
.then({
top: '-=40',
start: function () {} // third part started
})
.start() And a wait method might come in handy, since we're sequencing. morpheus.series(el, {
opacity: 1
})
.wait(400)
.then({
top: '-=40'
}) All of these should be cancelable via the |
I'm easy, as long as I can do it directly off I like @danro's extensions but I imagine it getting pretty bloated internally to implement this; is it worth it? var series = morpheus(el, {
opacity: 1
, autostart: false // defaults to true
})
.wait(400)
.then({
top: '-=40'
})
series.start() |
👍 to everything @rvagg said. If we wanted to sequence tweens and morphs together, how would that look? It's a little confusing because (not to mention morpheus(el, {
opacity: 1
})
.wait(400)
.tween(1000,
function (position) {
// do stuff with position...
},
function () {
console.log('done')
},
easings.bounce,
100, // start
300 // end
)
.then({
top: '-=40'
})
// even more confusing when reversed:
morpheus.tween(1000,
function (position) {
// do stuff with position...
},
function () {
console.log('done')
},
easings.bounce,
100, // start
300 // end
)
.then(el, { // first time 'el' is mentioned in the series
opacity: 1
})
.wait(400)
.then({
top: '-=40'
}) |
i think i'm a bit less attached to having morpheus do it straight away (same with |
While we're talking about Like as an alternative to using var vector = { x: 0, y: 0 };
morpheus(vector, {
duration: 1000,
x: 100,
y: 200,
update: function () {}, // does something with vector
complete: function () {},
easing: 'easeOutQuint'
}) Only caveat being that you have some reserved property names for Could see this being super useful when paired with canvas or webgl. |
Heyo,
I'd like to gather some thoughts on having a deferred interface for Morpheus would look like. I had some thoughts...
the first seems most attractive, however it's not necessarily callback based, but rather a continual pass of an options hash....
this would execute each in order, each waiting for the previous to complete.
another implementation would be just to pass in functions, each executing immediately after the original animation is done....
even yet another spin on that — passback
complete
methods...or we could spin up a new method that works like the first example, just on a different method...
thoughts?
The text was updated successfully, but these errors were encountered: