@brandocms/jupiter 3.48.1 → 3.48.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -82,6 +82,7 @@ const DEFAULT_OPTIONS = {
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
|
+
|
|
85
86
|
export default class Application {
|
|
86
87
|
constructor(opts = {}) {
|
|
87
88
|
this.debugType = 1
|
|
@@ -543,8 +544,9 @@ export default class Application {
|
|
|
543
544
|
*/
|
|
544
545
|
setvh100() {
|
|
545
546
|
const root = document.querySelector(':root')
|
|
546
|
-
|
|
547
|
-
root.style.setProperty('--vp-
|
|
547
|
+
const height = this.featureTests.results.ios ? screen.height : window.innerHeight
|
|
548
|
+
root.style.setProperty('--vp-100vh', `${height}px`)
|
|
549
|
+
root.style.setProperty('--vp-1vh', `${height * 0.01}px`)
|
|
548
550
|
}
|
|
549
551
|
|
|
550
552
|
setvw100() {
|
|
@@ -8,6 +8,9 @@ const DEFAULT_OPTIONS = {
|
|
|
8
8
|
/* enable captions */
|
|
9
9
|
captions: false,
|
|
10
10
|
|
|
11
|
+
/* enable index numbers */
|
|
12
|
+
numbers: false,
|
|
13
|
+
|
|
11
14
|
/* enable swipe — this breaks native zoom! */
|
|
12
15
|
swipe: true,
|
|
13
16
|
|
|
@@ -73,6 +76,10 @@ const DEFAULT_OPTIONS = {
|
|
|
73
76
|
lightbox.timelines.image.to(lightbox.nextImage, { duration: 0.5, autoAlpha: 1, delay })
|
|
74
77
|
},
|
|
75
78
|
|
|
79
|
+
onNumbers: (lightbox, section) => {
|
|
80
|
+
lightbox.elements.numbers.innerHTML = `${lightbox.currentIndex + 1}/${section.length}`
|
|
81
|
+
},
|
|
82
|
+
|
|
76
83
|
onBeforeOpen: () => {},
|
|
77
84
|
|
|
78
85
|
onOpen: h => {
|
|
@@ -177,6 +184,7 @@ export default class Lightbox {
|
|
|
177
184
|
this.elements.content = document.createElement('div')
|
|
178
185
|
this.elements.imgWrapper = document.createElement('div')
|
|
179
186
|
this.elements.dots = document.createElement('div')
|
|
187
|
+
this.elements.numbers = document.createElement('div')
|
|
180
188
|
this.elements.nextArrow = document.createElement('a')
|
|
181
189
|
this.elements.prevArrow = document.createElement('a')
|
|
182
190
|
this.elements.close = document.createElement('a')
|
|
@@ -188,6 +196,7 @@ export default class Lightbox {
|
|
|
188
196
|
this.elements.prevArrow.classList.add('lightbox-prev')
|
|
189
197
|
this.elements.close.classList.add('lightbox-close')
|
|
190
198
|
this.elements.dots.classList.add('lightbox-dots')
|
|
199
|
+
this.elements.numbers.classList.add('lightbox-numbers')
|
|
191
200
|
this.elements.wrapper.classList.add('lightbox-backdrop')
|
|
192
201
|
this.elements.wrapper.setAttribute('data-lightbox-wrapper-section', section)
|
|
193
202
|
this.elements.imgWrapper.classList.add('lightbox-image-wrapper')
|
|
@@ -210,9 +219,12 @@ export default class Lightbox {
|
|
|
210
219
|
this.setImg(section, this.getPrevIdx(section))
|
|
211
220
|
})
|
|
212
221
|
|
|
213
|
-
|
|
222
|
+
this.keyUpCallback = event => {
|
|
214
223
|
this.onKeyup(event, section)
|
|
215
|
-
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
document.removeEventListener('keyup', this.keyUpCallback)
|
|
227
|
+
document.addEventListener('keyup', this.keyUpCallback)
|
|
216
228
|
|
|
217
229
|
this.elements.wrapper.addEventListener('mousemove', event => {
|
|
218
230
|
this.onMouseMove(event)
|
|
@@ -264,6 +276,10 @@ export default class Lightbox {
|
|
|
264
276
|
this.elements.content.appendChild(this.elements.prevArrow)
|
|
265
277
|
this.elements.content.appendChild(this.elements.dots)
|
|
266
278
|
|
|
279
|
+
if (this.opts.numbers) {
|
|
280
|
+
this.elements.content.appendChild(this.elements.numbers)
|
|
281
|
+
}
|
|
282
|
+
|
|
267
283
|
if (this.opts.captions) {
|
|
268
284
|
this.elements.caption = document.createElement('div')
|
|
269
285
|
this.elements.caption.classList.add('lightbox-caption')
|
|
@@ -273,7 +289,7 @@ export default class Lightbox {
|
|
|
273
289
|
this.elements.wrapper.appendChild(this.elements.content)
|
|
274
290
|
document.body.appendChild(this.elements.wrapper)
|
|
275
291
|
|
|
276
|
-
this.setImg(section, index, this.getPrevIdx(
|
|
292
|
+
this.setImg(section, index, this.getPrevIdx(section))
|
|
277
293
|
if (this.opts.swipe) {
|
|
278
294
|
this.attachSwiper(section, this.elements.content, index)
|
|
279
295
|
}
|
|
@@ -289,7 +305,7 @@ export default class Lightbox {
|
|
|
289
305
|
}
|
|
290
306
|
|
|
291
307
|
close() {
|
|
292
|
-
document.removeEventListener('keyup', this.
|
|
308
|
+
document.removeEventListener('keyup', this.keyUpCallback)
|
|
293
309
|
this.opts.onClose(this)
|
|
294
310
|
this.opts.onAfterClose(this)
|
|
295
311
|
this.currentIndex = null
|
|
@@ -326,6 +342,10 @@ export default class Lightbox {
|
|
|
326
342
|
})
|
|
327
343
|
}
|
|
328
344
|
|
|
345
|
+
if (this.elements.numbers) {
|
|
346
|
+
this.opts.onNumbers(this, this.sections[section])
|
|
347
|
+
}
|
|
348
|
+
|
|
329
349
|
if (this.currentImage) {
|
|
330
350
|
// fade out current image
|
|
331
351
|
this.opts.onImageOut(this)
|