Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
apply data-transition-duration to arbitrary steps #142
Step transitions that zoom way in or out can be very jarring using impress.js. Setting the transition duration the #impress element is perfect for most transitions, but usually too short for transitions that zoom significantly. Is it possible to set transition timings for individual steps to mitigate this issue?
First of all, thanks a lot for impress.js - it's impressiv and lots of fun ;-)
I had the same question as kjmatthewes. I solved this by adding a few new if-queries right at the beginning of the getStep function in impress.js (around line 400) looking something like this:
Since mostly presentation play back is from beginning to end the transitionDuration only has to be changed for very few steps to a longer or back to a shorter period.
Here is the workaround that works for me:
Make a copy of the transitionDuration variable in the config element definition. Add this line in the definition (approx line 346):
What that line does is it makes a copy of the transitionDuration variable, which would be required to reset the transition duration to the value specified in the root
Then add this line at the beginning of the getStep method (approx line 400):
Now you can specify the transition duration of any step by giving a value to the
referenced this issue
Mar 19, 2016
FYI, I implemented this simple request now in my repo, see this commit
(I was actually going to merge the patch above from @FagnerMartinsBrack, but it doesn't work in current impress.js anymore, and ultimately when I was finished there was not a single line left from that patch, so didn't put you as author, but thanks for the proof of concept anyway.)
I feel the appropriate transition speed could be better adjusted per transition. Basically take the global setting (Which can be assumed as an on-plane 1 slide shift of camera position), and have scaling factors that change the transition time based on distance to travel along a vision path from old to new position.