(imagesLoaded, Hammer)
| 12 | */ |
| 13 | |
| 14 | function defineSequence(imagesLoaded, Hammer) { |
| 15 | |
| 16 | 'use strict'; |
| 17 | |
| 18 | var instances = [], |
| 19 | instance = 0; |
| 20 | |
| 21 | /** |
| 22 | * Sequence function |
| 23 | * |
| 24 | * @param {Object} element - the element Sequence is bound to |
| 25 | * @param {Object} options - this instance's options |
| 26 | * @returns {Object} self - Properties and methods available to this instance |
| 27 | */ |
| 28 | var Sequence = (function (element, options) { |
| 29 | |
| 30 | var instanceId = element.getAttribute("data-seq-enabled"); |
| 31 | |
| 32 | // Prevent multiple instances on the same element. Return the object instead |
| 33 | if (instanceId !== null) { |
| 34 | return instances[instanceId]; |
| 35 | } |
| 36 | |
| 37 | // The element now has Sequence attached to it |
| 38 | element.setAttribute("data-seq-enabled", instance); |
| 39 | instance++; |
| 40 | |
| 41 | /* --- PRIVATE VARIABLES/FUNCTIONS --- */ |
| 42 | |
| 43 | // Default Sequence settings |
| 44 | var defaults = { |
| 45 | |
| 46 | /* --- General --- */ |
| 47 | |
| 48 | // The first step to show |
| 49 | startingStepId: 1, |
| 50 | |
| 51 | // Should the starting step animate in to begin with? |
| 52 | startingStepAnimatesIn: false, |
| 53 | |
| 54 | // When the last step is reached, should Sequence cycle back to the start? |
| 55 | cycle: true, |
| 56 | |
| 57 | // How long to wait between the current phase animating out, and the next |
| 58 | // animating in. |
| 59 | phaseThreshold: true, |
| 60 | |
| 61 | // Should transitions be reversed when navigating backwards? |
| 62 | reverseWhenNavigatingBackwards: false, |
| 63 | |
| 64 | // Should transition-timing-function be reversed when navigating backwards? |
| 65 | reverseTimingFunctionWhenNavigatingBackwards: false, |
| 66 | |
| 67 | // Should the active step be given a higher z-index? |
| 68 | moveActiveStepToTop: true, |
| 69 | |
| 70 | |
| 71 | /* --- Canvas Animation --- */ |
no test coverage detected
searching dependent graphs…