|
28 | 28 | var sr
|
29 | 29 | var _requestAnimationFrame
|
30 | 30 |
|
| 31 | + function ScrollReveal (config) { |
| 32 | + // Support instantiation without the `new` keyword. |
| 33 | + if (typeof this === 'undefined' || Object.getPrototypeOf(this) !== ScrollReveal.prototype) { |
| 34 | + return new ScrollReveal(config) |
| 35 | + } |
| 36 | + |
| 37 | + sr = this // Save reference to instance. |
| 38 | + sr.version = '3.1.5' |
| 39 | + sr.tools = new Tools() // *required utilities |
| 40 | + |
| 41 | + if (sr.isSupported()) { |
| 42 | + sr.tools.extend(sr.defaults, config || {}) |
| 43 | + |
| 44 | + _resolveContainer(sr.defaults) |
| 45 | + |
| 46 | + sr.store = { |
| 47 | + elements: {}, |
| 48 | + containers: [] |
| 49 | + } |
| 50 | + |
| 51 | + sr.sequences = {} |
| 52 | + sr.history = [] |
| 53 | + sr.uid = 0 |
| 54 | + sr.initialized = false |
| 55 | + } else if (typeof console !== 'undefined' && console !== null) { |
| 56 | + // Note: IE9 only supports console if devtools are open. |
| 57 | + console.log('ScrollReveal is not supported in this browser.') |
| 58 | + } |
| 59 | + |
| 60 | + return sr |
| 61 | + } |
| 62 | + |
31 | 63 | /**
|
32 | 64 | * Configuration
|
33 | 65 | * -------------
|
|
93 | 125 | afterReset: function (domEl) {}
|
94 | 126 | }
|
95 | 127 |
|
96 |
| - function ScrollReveal (config) { |
97 |
| - // Support instantiation without the `new` keyword. |
98 |
| - if (typeof this === 'undefined' || Object.getPrototypeOf(this) !== ScrollReveal.prototype) { |
99 |
| - return new ScrollReveal(config) |
100 |
| - } |
101 |
| - |
102 |
| - sr = this // Save reference to instance. |
103 |
| - sr.tools = new Tools() // *required utilities |
104 |
| - |
105 |
| - if (sr.isSupported()) { |
106 |
| - sr.tools.extend(sr.defaults, config || {}) |
107 |
| - |
108 |
| - _resolveContainer(sr.defaults) |
109 |
| - |
110 |
| - sr.store = { |
111 |
| - elements: {}, |
112 |
| - containers: [] |
113 |
| - } |
114 |
| - |
115 |
| - sr.sequences = {} |
116 |
| - sr.history = [] |
117 |
| - sr.uid = 0 |
118 |
| - sr.initialized = false |
119 |
| - } else if (typeof console !== 'undefined' && console !== null) { |
120 |
| - // Note: IE9 only supports console if devtools are open. |
121 |
| - console.log('ScrollReveal is not supported in this browser.') |
122 |
| - } |
123 |
| - |
124 |
| - return sr |
125 |
| - } |
126 |
| - |
127 | 128 | /**
|
128 | 129 | * Check if client supports CSS Transform and CSS Transition.
|
129 | 130 | * @return {boolean}
|
|
0 commit comments