Füge Übergangseffekte für das Overlay hinzu und aktualisiere die Sichtbarkeit bei Berührungen
All checks were successful
Deploy via FTP / deploy (push) Successful in 3s
All checks were successful
Deploy via FTP / deploy (push) Successful in 3s
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
document.addEventListener('DOMContentLoaded', function(){
|
||||
const stage = document.getElementById('stage');
|
||||
const overlay = document.getElementById('overlay');
|
||||
const touches = new Map(); // id -> {el,x,y,colorIdx}
|
||||
const MAX_TOUCHES = /iPhone/.test(navigator.userAgent) ? 5 : 20;
|
||||
const COLOR_CLASSES = ['c1','c2','c3','c4','c5','c6','c7','c8'];
|
||||
@@ -139,6 +140,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||
nodes.forEach(node=>node.remove());
|
||||
touches.clear();
|
||||
usedColors.clear();
|
||||
overlay.classList.remove('hidden');
|
||||
},160);
|
||||
}
|
||||
}
|
||||
@@ -150,6 +152,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||
const prevSize = touches.size;
|
||||
changed.forEach(t=>{ if(touches.size < MAX_TOUCHES) createFinger(t); });
|
||||
if(touches.size > prevSize){
|
||||
overlay.classList.add('hidden');
|
||||
cancelSelection();
|
||||
selectionTimer = setTimeout(startSelectionIfNeeded, 700);
|
||||
}
|
||||
@@ -184,6 +187,7 @@ document.addEventListener('DOMContentLoaded', function(){
|
||||
const mouseId = 'mouse';
|
||||
stage.addEventListener('mousedown', function(e){
|
||||
mouseDown = true;
|
||||
overlay.classList.add('hidden');
|
||||
createFinger({identifier:mouseId, clientX:e.clientX, clientY:e.clientY});
|
||||
cancelSelection();
|
||||
startSelectionIfNeeded();
|
||||
|
||||
Reference in New Issue
Block a user