You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is an idea @bartaz has discussed with me as I became active in this project. I'm writing down this ticket now triggered by #649.
The basic idea is to simplify the core even more, so that core just moves the viewport to given coordinates. Even the parsing of data-x/y/z attributes would move out of core to some kind of step-positioning plugin.
As a first pass, I'm going to include the concept of a step as a core object though. It is common for animation software to build animations out of steps, so this seems justified. This will result in a more complex api, not less.
Core objects:
a step
an order between steps (array & current index)
a camera (internally canvas + root objects)
The new API could therefore be:
addStep(element, coordinates, [index]) // default: append. This would be the `css()` part of current `initStep()`
removeStep(index)
getSteps() // return: array
getCurrentStep() // return: {index: ..., el: ..., coordinates: ...}
// Move camera to arbitrary coordinates
// Coordinates is essentially this object: https://github.com/impress/impress.js/blob/master/src/impress.js#L282
setCoordinates(coordinates)
getCoordinates()
panZoom(relativeCoordinates)
// The rest stay same as before, but goto() now becomes setCoordinates(getSteps()[target].coordinates))
goto(target) // as currently, target can be an index, step id
next()
prev()
init()
tear()
lib()
What could move out of core:
swipe() can now move to touch plugin and just call setCoordinates() repeatedly to animate the swipe.
Most of initAllSteps() and initStep() can become 1 or 2 new plugins, which parse DOM attributes and call addStep().
I believe addPreInitPlugin() can then be removed and rel and extras can become normal plugins triggered by impress:init.
A completely separate question is whether we should adopt the new import/export type modules. impress.js historically was always targeting state of the art JavaScript. But this ticket is valid either way.
The text was updated successfully, but these errors were encountered:
henrikingo
changed the title
Refactor: Make core a general "3D animation API", move next/prev to plugin
Refactor: Make core a general "3D animation API", move parsing of steps to plugin
Sep 22, 2019
I am going to be looking into doing this in December this year or January next year when I have time again to work on other projects than my current ones
This is an idea @bartaz has discussed with me as I became active in this project. I'm writing down this ticket now triggered by #649.
The basic idea is to simplify the core even more, so that core just moves the viewport to given coordinates. Even the parsing of
data-x/y/z
attributes would move out of core to some kind of step-positioning plugin.As a first pass, I'm going to include the concept of a step as a core object though. It is common for animation software to build animations out of steps, so this seems justified. This will result in a more complex api, not less.
Core objects:
The new API could therefore be:
What could move out of core:
swipe()
can now move totouch
plugin and just callsetCoordinates()
repeatedly to animate the swipe.initAllSteps()
andinitStep()
can become 1 or 2 new plugins, which parse DOM attributes and call addStep().addPreInitPlugin()
can then be removed andrel
andextras
can become normal plugins triggered byimpress:init
.The text was updated successfully, but these errors were encountered: