Comments (2)
Hi,
this is definitely an interesting proposal.
Your ID system could do the trick but maybe we could instead add a higher lever function animatePaper.sequence()
, which would be more flexible.
A sequence being a collection of animations, similar to animatePaper.animate([])
but with more options such as repeat
, callbacks, etc.
The API would be something like:
const mySequence = animatePaper.sequence({
repeat: 2,
complete: () => { /*...*/},
steps: [ /* animations */ ]
});
mySequence.run(item);
And, to achieve your fadeIn/pulse/fadeOut combo, the idea would be to nest sequences:
const pulseSequence = animatePaper.sequence({
repeat: 2,
steps: [
{
properties: {
scale: 1.5,
},
settings: {
duration: 100
}
},
{
properties: {
scale: 1,
},
settings: {
duration: 900
}
}
]
});
const mySequence = animatePaper.sequence({
complete: () => { console.log('sequence complete'); },
steps: [
{ // animation
{
properties: {
opacity: 1,
},
settings: {
duration: 500,
}
},
pulseSequence, // nested sequence
// ... fadeOut animation ...
]
});
mySequence.run(item);
Kind of an enhanced version of the effects
API.
What do you think ?
from animatepaper.js.
Hi your sequence idea is cool :-)
i have done something 'similar' to allow animation of multiple objects at once with the MultiAnimation
Class
Usage example at: animation_arrows.js#L187
usage of svg/json auto-import
live example with svg/json auto-import (hit space to toggle)
i also like the nested sequence idea that is by fare the flexible solution..
what do you think about the next()
function to skip/switch to the next sequence step?
from animatepaper.js.
Related Issues (16)
- segmentGrow example HOT 1
- Browserify/AMD compatibility HOT 4
- Animate on specific Item' segment HOT 10
- Support animation "loop" HOT 1
- Rotate animation only works once HOT 4
- Animate "rotate" with reference point HOT 3
- animate position strange behavior HOT 6
- Animate "position" with moveOnPath
- easing - is there a list of buildin functions? HOT 4
- [question] Why is it not possible to animate Group fillColor? HOT 4
- add easing-option for CSS-style cubic-bezier curves HOT 1
- allow for absolute negative position values
- why is 0 as duration not allowed? [question] HOT 1
- How to animate scale when scaleX and scaleY are different? HOT 1
- Use with ffmpegserver.js?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from animatepaper.js.