*
* version 1.1:
* - Optional progress bar UI element
+ * - Slide overview available via SPACE
*
* TODO:
* - Touch/swipe interactions
* can't be improved.
*/
function activateOverview() {
- var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
-
document.body.classList.add( 'overview' );
+ var horizontalSlides = Array.prototype.slice.call( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ) );
+
for( var i = 0, len = horizontalSlides.length; i < len; i++ ) {
var hslide = horizontalSlides[i],
htransform = 'translateZ(-2500px) translate(' + ( ( i - indexh ) * 105 ) + '%, 0%)';
function navigateLeft() {
// Prioritize hiding fragments
- if( previousFragment() === false ) {
+ if( overviewIsActive() || previousFragment() === false ) {
indexh --;
indexv = 0;
slide();
}
function navigateRight() {
// Prioritize revealing fragments
- if( nextFragment() === false ) {
+ if( overviewIsActive() || nextFragment() === false ) {
indexh ++;
indexv = 0;
slide();
}
function navigateUp() {
// Prioritize hiding fragments
- if( previousFragment() === false ) {
+ if( overviewIsActive() || previousFragment() === false ) {
indexv --;
slide();
}
}
function navigateDown() {
// Prioritize revealing fragments
- if( nextFragment() === false ) {
+ if( overviewIsActive() || nextFragment() === false ) {
indexv ++;
slide();
}