@mixd-id/web-scaffold 0.1.230406202 → 0.1.230406204
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
|
@@ -251,17 +251,21 @@ export default{
|
|
|
251
251
|
},
|
|
252
252
|
|
|
253
253
|
disableBodyScroll(){
|
|
254
|
-
this
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
254
|
+
if(this.$isTouchSupported()){
|
|
255
|
+
this.scrollPosition = window.pageYOffset || document.documentElement.offsetTop
|
|
256
|
+
document.body.classList.add(this.$style.htmlNoScroll)
|
|
257
|
+
document.body.classList.add(this.$style.bodyNoScroll)
|
|
258
|
+
document.body.style.top = `-${this.scrollPosition}px`;
|
|
259
|
+
}
|
|
258
260
|
},
|
|
259
261
|
|
|
260
262
|
enableBodyScroll(){
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
263
|
+
if(this.$isTouchSupported()){
|
|
264
|
+
document.body.style.removeProperty('top');
|
|
265
|
+
document.body.classList.remove(this.$style.bodyNoScroll)
|
|
266
|
+
document.body.classList.remove(this.$style.htmlNoScroll)
|
|
267
|
+
window.scrollTo(0, this.scrollPosition);
|
|
268
|
+
}
|
|
265
269
|
},
|
|
266
270
|
|
|
267
271
|
mouseDown(e){
|
|
@@ -360,23 +364,21 @@ export default{
|
|
|
360
364
|
@apply bg-primary-500;
|
|
361
365
|
}
|
|
362
366
|
|
|
363
|
-
|
|
364
|
-
.
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
-webkit-overflow-scrolling: touch;
|
|
379
|
-
}
|
|
367
|
+
.htmlNoScroll{
|
|
368
|
+
min-height: 100.3%;
|
|
369
|
+
overscroll-behavior-y: none;
|
|
370
|
+
height: 100%;
|
|
371
|
+
overflow: hidden;
|
|
372
|
+
}
|
|
373
|
+
.bodyNoScroll{
|
|
374
|
+
overscroll-behavior: none;
|
|
375
|
+
overscroll-behavior-y: none;
|
|
376
|
+
overflow: hidden;
|
|
377
|
+
position: fixed;
|
|
378
|
+
width: 100%;
|
|
379
|
+
margin: 0;
|
|
380
|
+
max-height: 100%;
|
|
381
|
+
-webkit-overflow-scrolling: touch;
|
|
380
382
|
}
|
|
381
383
|
|
|
382
384
|
|
package/src/components/Image.vue
CHANGED
|
@@ -94,8 +94,8 @@ export default{
|
|
|
94
94
|
|
|
95
95
|
mounted(){
|
|
96
96
|
this.$observe.once(this.$el, () => {
|
|
97
|
-
|
|
98
|
-
|
|
97
|
+
this.isVisible = true
|
|
98
|
+
this.loadSrc()
|
|
99
99
|
})
|
|
100
100
|
|
|
101
101
|
this.$resize(this.onResize)
|
|
@@ -168,7 +168,7 @@ export default{
|
|
|
168
168
|
|
|
169
169
|
let imgSrc
|
|
170
170
|
for(const b in screens){
|
|
171
|
-
if(
|
|
171
|
+
if(document.documentElement.clientWidth > b && screens[b] in src){
|
|
172
172
|
imgSrc = src[screens[b]]
|
|
173
173
|
}
|
|
174
174
|
}
|
|
@@ -201,7 +201,7 @@ export default{
|
|
|
201
201
|
|
|
202
202
|
let imgSrc
|
|
203
203
|
for(const b in screens){
|
|
204
|
-
if(
|
|
204
|
+
if(document.documentElement.clientWidth > b && screens[b] in src){
|
|
205
205
|
imgSrc = src[screens[b]]
|
|
206
206
|
}
|
|
207
207
|
}
|
|
@@ -260,7 +260,7 @@ export default{
|
|
|
260
260
|
watch:{
|
|
261
261
|
|
|
262
262
|
src(to, from){
|
|
263
|
-
|
|
263
|
+
this.loadSrc()
|
|
264
264
|
},
|
|
265
265
|
|
|
266
266
|
}
|
package/src/index.js
CHANGED
|
@@ -266,6 +266,10 @@ const util = {
|
|
|
266
266
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
const isTouchSupported = () => {
|
|
270
|
+
return 'ontouchstart' in window || navigator.maxTouchPoints > 0 || navigator.msMaxTouchPoints > 0
|
|
271
|
+
}
|
|
272
|
+
|
|
269
273
|
export default{
|
|
270
274
|
|
|
271
275
|
install: (app, options) => {
|
|
@@ -339,6 +343,7 @@ export default{
|
|
|
339
343
|
app.config.globalProperties.time = consoleTime
|
|
340
344
|
app.config.globalProperties.timeLog = consoleTimeLog
|
|
341
345
|
app.config.globalProperties.timeEnd = consoleTimeEnd
|
|
346
|
+
app.config.globalProperties.$isTouchSupported = isTouchSupported
|
|
342
347
|
|
|
343
348
|
app.config.globalProperties.$isDev = () => import.meta.env.DEV
|
|
344
349
|
|