@thinkpixellab-public/px-vue 3.0.45 → 3.0.47
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/components/PxSlides.vue +35 -6
- package/package.json +1 -1
package/components/PxSlides.vue
CHANGED
|
@@ -82,7 +82,27 @@ export default {
|
|
|
82
82
|
scrollPreview: 0,
|
|
83
83
|
};
|
|
84
84
|
},
|
|
85
|
-
computed: {
|
|
85
|
+
computed: {
|
|
86
|
+
lethargyOverrides() {
|
|
87
|
+
const stability = parseFloat(this.$route.query?.scrollStability);
|
|
88
|
+
const sensitivity = parseFloat(this.$route.query?.scrollSensitivity);
|
|
89
|
+
const tolerance = parseFloat(this.$route.query?.scrollTolerance);
|
|
90
|
+
|
|
91
|
+
if (stability || sensitivity || tolerance) {
|
|
92
|
+
console.log('[Custom scroll values enabled.]');
|
|
93
|
+
console.log(`stability: ${stability || 8}`);
|
|
94
|
+
console.log(`sensitivity: ${sensitivity || 100}`);
|
|
95
|
+
console.log(`tolerance: ${tolerance || 1.1}`);
|
|
96
|
+
|
|
97
|
+
return {
|
|
98
|
+
stability: stability || 8,
|
|
99
|
+
sensitivity: sensitivity || 100,
|
|
100
|
+
tolerance: tolerance || 1.1,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return null;
|
|
104
|
+
},
|
|
105
|
+
},
|
|
86
106
|
watch: {
|
|
87
107
|
syncSelected(nv, ov) {
|
|
88
108
|
let newIndex = this.itemKeys.indexOf(nv);
|
|
@@ -122,6 +142,20 @@ export default {
|
|
|
122
142
|
});
|
|
123
143
|
|
|
124
144
|
if (this.scrollEnabled) {
|
|
145
|
+
let overrides = this.lethargyOverrides;
|
|
146
|
+
|
|
147
|
+
if (overrides) {
|
|
148
|
+
this.lethargy = new Lethargy(
|
|
149
|
+
overrides.stability,
|
|
150
|
+
overrides.sensitivity,
|
|
151
|
+
overrides.tolerance
|
|
152
|
+
);
|
|
153
|
+
} else {
|
|
154
|
+
this.lethargy = new Lethargy();
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
this.lethargyPrevCheck = false;
|
|
158
|
+
|
|
125
159
|
this.$el.addEventListener('wheel', this.onWheel);
|
|
126
160
|
}
|
|
127
161
|
},
|
|
@@ -180,11 +214,6 @@ export default {
|
|
|
180
214
|
},
|
|
181
215
|
|
|
182
216
|
onWheel(e) {
|
|
183
|
-
if (typeof this.lethargy == 'undefined') {
|
|
184
|
-
this.lethargy = new Lethargy();
|
|
185
|
-
this.lethargyPrevCheck = false;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
217
|
if (this.scrollPreviewEnabled) {
|
|
189
218
|
const delta = (e.deltaY + e.deltaX) / 2;
|
|
190
219
|
if (Math.abs(delta) > 5) {
|