casi final
This commit is contained in:
parent
77abdef9ab
commit
5263520d5d
@ -27,7 +27,6 @@
|
||||
|
||||
|
||||
|
||||
|
||||
{% endblock body %}
|
||||
|
||||
{% block js %}
|
||||
|
@ -24,6 +24,16 @@
|
||||
}
|
||||
|
||||
|
||||
.floating-btn {
|
||||
touch-action: none; /* Evita que el navegador maneje los eventos touch */
|
||||
}
|
||||
|
||||
@media (hover: none) {
|
||||
.floating-btn {
|
||||
cursor: pointer; /* Cambia el cursor en dispositivos táctiles */
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<div class="floating-btn border border-light shadow-lg" id="floatingBtn">
|
||||
@ -119,24 +129,6 @@
|
||||
savePosition(x, y);
|
||||
}
|
||||
|
||||
// function startTouch(e) {
|
||||
// if (e.touches.length !== 1) return;
|
||||
|
||||
// hasMoved = false;
|
||||
// const touch = e.touches[0];
|
||||
// const startX = touch.clientX;
|
||||
// const startY = touch.clientY;
|
||||
|
||||
// touchStartTimer = setTimeout(() => {
|
||||
// // Si el temporizador termina y no ha habido movimiento, consideramos un tap
|
||||
// link.click();
|
||||
// }, tapThreshold);
|
||||
|
||||
// // Preparar para el movimiento
|
||||
// const rect = btn.getBoundingClientRect();
|
||||
// offsetX = startX - rect.left;
|
||||
// offsetY = startY - rect.top;
|
||||
// }
|
||||
|
||||
function startTouch(e) {
|
||||
if (e.touches.length !== 1) return;
|
||||
@ -158,26 +150,7 @@
|
||||
}, tapThreshold);
|
||||
}
|
||||
|
||||
// function moveTouch(e) {
|
||||
// if (!touchStartTimer || e.touches.length !== 1) return;
|
||||
|
||||
// const touch = e.touches[0];
|
||||
// const currentX = touch.clientX;
|
||||
// const currentY = touch.clientY;
|
||||
|
||||
// // Verificar si el movimiento supera el umbral
|
||||
// if (Math.abs(currentX - (touch.clientX - offsetX)) > moveThreshold || Math.abs(currentY - (touch.clientY - offsetY)) > moveThreshold) {
|
||||
// clearTimeout(touchStartTimer); // Cancelar el temporizador si hay movimiento
|
||||
// isDragging = true;
|
||||
// hasMoved = true;
|
||||
|
||||
// btn.style.cursor = 'grabbing';
|
||||
// btn.style.left = `${currentX - offsetX}px`;
|
||||
// btn.style.top = `${currentY - offsetY}px`;
|
||||
// btn.style.right = 'auto';
|
||||
// e.preventDefault(); // Evitar el scroll durante el arrastre
|
||||
// }
|
||||
// }
|
||||
|
||||
function moveTouch(e) {
|
||||
if (!touchStartTimer || e.touches.length !== 1 || !initialTouchX) return;
|
||||
@ -201,17 +174,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// function endTouch(e) {
|
||||
// clearTimeout(touchStartTimer);
|
||||
// if (isDragging) {
|
||||
// isDragging = false;
|
||||
// btn.style.cursor = 'move';
|
||||
// const rect = btn.getBoundingClientRect();
|
||||
// stickToNearestSide(rect.left, rect.top);
|
||||
// savePosition(rect.left, rect.top);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
function endTouch(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user