@mixd-id/web-scaffold 0.1.230406207 → 0.1.230406208
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 +1 -1
- package/src/components/Carousel.vue +9 -36
package/package.json
CHANGED
|
@@ -216,7 +216,6 @@ export default{
|
|
|
216
216
|
const sy = typeof e.touches !== 'undefined' ? e.touches[0].clientY : e.clientY
|
|
217
217
|
const dx = sx - this._props['sx']
|
|
218
218
|
const dy = sy - this._props['sy']
|
|
219
|
-
const ix = parseInt(this._props['ix'] + dx)
|
|
220
219
|
|
|
221
220
|
if(!this._props['direction']){
|
|
222
221
|
if(Math.abs(dy) > 3){
|
|
@@ -228,6 +227,15 @@ export default{
|
|
|
228
227
|
}
|
|
229
228
|
}
|
|
230
229
|
else if(this._props['direction'] === 'horizontal'){
|
|
230
|
+
let ix
|
|
231
|
+
if((this.index === this.items.length - 1 && dx < 0) ||
|
|
232
|
+
(this.index === 0 && dx > 0)){
|
|
233
|
+
ix = parseInt(this._props['ix'] + (dx * .23812))
|
|
234
|
+
}
|
|
235
|
+
else{
|
|
236
|
+
ix = parseInt(this._props['ix'] + dx)
|
|
237
|
+
}
|
|
238
|
+
|
|
231
239
|
this.$el.firstElementChild.style.transform = `translate3d(${ix}px, 0, 0)`
|
|
232
240
|
}
|
|
233
241
|
|
|
@@ -264,24 +272,6 @@ export default{
|
|
|
264
272
|
this.play()
|
|
265
273
|
},
|
|
266
274
|
|
|
267
|
-
disableBodyScroll(){
|
|
268
|
-
if(this.$isTouchSupported()){
|
|
269
|
-
this.scrollPosition = window.pageYOffset || document.documentElement.offsetTop
|
|
270
|
-
document.body.classList.add(this.$style.htmlNoScroll)
|
|
271
|
-
document.body.classList.add(this.$style.bodyNoScroll)
|
|
272
|
-
document.body.style.top = `-${this.scrollPosition}px`;
|
|
273
|
-
}
|
|
274
|
-
},
|
|
275
|
-
|
|
276
|
-
enableBodyScroll(){
|
|
277
|
-
if(this.$isTouchSupported()){
|
|
278
|
-
document.body.style.removeProperty('top');
|
|
279
|
-
document.body.classList.remove(this.$style.bodyNoScroll)
|
|
280
|
-
document.body.classList.remove(this.$style.htmlNoScroll)
|
|
281
|
-
window.scrollTo(0, this.scrollPosition);
|
|
282
|
-
}
|
|
283
|
-
},
|
|
284
|
-
|
|
285
275
|
mouseDown(e){
|
|
286
276
|
if(!this.items || this.items.length <= 1)
|
|
287
277
|
return
|
|
@@ -378,22 +368,5 @@ export default{
|
|
|
378
368
|
@apply bg-primary-500;
|
|
379
369
|
}
|
|
380
370
|
|
|
381
|
-
.htmlNoScroll{
|
|
382
|
-
min-height: 100.3%;
|
|
383
|
-
overscroll-behavior-y: none;
|
|
384
|
-
height: 100%;
|
|
385
|
-
overflow: hidden;
|
|
386
|
-
}
|
|
387
|
-
.bodyNoScroll{
|
|
388
|
-
overscroll-behavior: none;
|
|
389
|
-
overscroll-behavior-y: none;
|
|
390
|
-
overflow: hidden;
|
|
391
|
-
position: fixed;
|
|
392
|
-
width: 100%;
|
|
393
|
-
margin: 0;
|
|
394
|
-
max-height: 100%;
|
|
395
|
-
-webkit-overflow-scrolling: touch;
|
|
396
|
-
}
|
|
397
|
-
|
|
398
371
|
|
|
399
372
|
</style>
|