51 lines
1.2 KiB
HTML
51 lines
1.2 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en" class="w-h-full">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<link rel="icon" href="/favicon.ico">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>北斗启航科技教育平台</title>
|
|
<style>
|
|
/* 禁止移动端左右滑动事件 */
|
|
html {
|
|
touch-action: none;
|
|
touch-action: pan-y;
|
|
}
|
|
</style>
|
|
</head>
|
|
|
|
<body class="w-h-full">
|
|
<div id="app" class="w-h-full text-white"></div>
|
|
<script type="module" src="/src/main.js"></script>
|
|
<script>
|
|
// 禁止移动端左右滑动事件
|
|
document.addEventListener("touchmove", function (e) {
|
|
e.preventDefalut()
|
|
}, {
|
|
passive: false
|
|
});
|
|
|
|
|
|
var startX, startY;
|
|
document.addEventListener("touchstart", function (e) {
|
|
|
|
startX = e.targetTouches[0].pageX;
|
|
startY = e.targetTouches[0].pageY;
|
|
});
|
|
|
|
document.addEventListener("touchmove", function (e) {
|
|
|
|
var moveX = e.targetTouches[0].pageX;
|
|
var moveY = e.targetTouches[0].pageY;
|
|
|
|
if (Math.abs(moveX - startX) > Math.abs(moveY - startY)) {
|
|
e.preventDefault();
|
|
}
|
|
}, {
|
|
passive: false
|
|
});
|
|
</script>
|
|
</body>
|
|
|
|
</html> |