const toggle = document.getElementById("menu-toggle"); const options = document.getElementById("menu-options"); const menu = document.getElementById("floating-menu"); /* POSICIÓN GUARDADA */ const savedX = localStorage.getItem("menuX"); const savedY = localStorage.getItem("menuY"); if(savedX && savedY){ menu.style.left = savedX + "px"; menu.style.top = savedY + "px"; menu.style.right = "auto"; }else{ menu.style.left = (window.innerWidth - 110) + "px"; menu.style.top = "20px"; } /* ABRIR MENÚ */ toggle.addEventListener("click", () => { options.classList.toggle("open"); }); /* APARECER AL BAJAR */ window.addEventListener("scroll", () => { if(window.scrollY > 80){ menu.classList.add("show"); }else{ menu.classList.remove("show"); } }); /* DRAG */ let isDragging = false; let offsetX = 0; let offsetY = 0; toggle.addEventListener("mousedown", startDrag); toggle.addEventListener("touchstart", startDrag); function startDrag(e){ isDragging = true; const touch = e.touches ? e.touches[0] : e; offsetX = touch.clientX - menu.offsetLeft; offsetY = touch.clientY - menu.offsetTop; menu.style.right = "auto"; } document.addEventListener("mousemove", drag); document.addEventListener("touchmove", drag); function drag(e){ if(!isDragging) return; const touch = e.touches ? e.touches[0] : e; const newX = touch.clientX - offsetX; const newY = touch.clientY - offsetY; menu.style.left = newX + "px"; menu.style.top = newY + "px"; localStorage.setItem("menuX", newX); localStorage.setItem("menuY", newY); } document.addEventListener("mouseup", stopDrag); document.addEventListener("touchend", stopDrag); function stopDrag(){ isDragging = false; }
const toggle = document.getElementById("menu-toggle"); const options = document.getElementById("menu-options"); const menu = document.getElementById("floating-menu"); /* POSICIÓN GUARDADA */ const savedX = localStorage.getItem("menuX"); const savedY = localStorage.getItem("menuY"); if(savedX && savedY){ menu.style.left = savedX + "px"; menu.style.top = savedY + "px"; menu.style.right = "auto"; }else{ menu.style.left = (window.innerWidth - 110) + "px"; menu.style.top = "20px"; } /* ABRIR MENÚ */ toggle.addEventListener("click", () => { options.classList.toggle("open"); }); /* APARECER AL BAJAR */ window.addEventListener("scroll", () => { if(window.scrollY > 80){ menu.classList.add("show"); }else{ menu.classList.remove("show"); } }); /* DRAG */ let isDragging = false; let offsetX = 0; let offsetY = 0; toggle.addEventListener("mousedown", startDrag); toggle.addEventListener("touchstart", startDrag); function startDrag(e){ isDragging = true; const touch = e.touches ? e.touches[0] : e; offsetX = touch.clientX - menu.offsetLeft; offsetY = touch.clientY - menu.offsetTop; menu.style.right = "auto"; } document.addEventListener("mousemove", drag); document.addEventListener("touchmove", drag); function drag(e){ if(!isDragging) return; const touch = e.touches ? e.touches[0] : e; const newX = touch.clientX - offsetX; const newY = touch.clientY - offsetY; menu.style.left = newX + "px"; menu.style.top = newY + "px"; localStorage.setItem("menuX", newX); localStorage.setItem("menuY", newY); } document.addEventListener("mouseup", stopDrag); document.addEventListener("touchend", stopDrag); function stopDrag(){ isDragging = false; }
const toggle = document.getElementById("menu-toggle"); const options = document.getElementById("menu-options"); const menu = document.getElementById("floating-menu"); /* POSICIÓN GUARDADA */ const savedX = localStorage.getItem("menuX"); const savedY = localStorage.getItem("menuY"); if(savedX && savedY){ menu.style.left = savedX + "px"; menu.style.top = savedY + "px"; menu.style.right = "auto"; }else{ menu.style.left = (window.innerWidth - 110) + "px"; menu.style.top = "20px"; } /* ABRIR MENÚ */ toggle.addEventListener("click", () => { options.classList.toggle("open"); }); /* APARECER AL BAJAR */ window.addEventListener("scroll", () => { if(window.scrollY > 80){ menu.classList.add("show"); }else{ menu.classList.remove("show"); } }); /* DRAG */ let isDragging = false; let offsetX = 0; let offsetY = 0; toggle.addEventListener("mousedown", startDrag); toggle.addEventListener("touchstart", startDrag); function startDrag(e){ isDragging = true; const touch = e.touches ? e.touches[0] : e; offsetX = touch.clientX - menu.offsetLeft; offsetY = touch.clientY - menu.offsetTop; menu.style.right = "auto"; } document.addEventListener("mousemove", drag); document.addEventListener("touchmove", drag); function drag(e){ if(!isDragging) return; const touch = e.touches ? e.touches[0] : e; const newX = touch.clientX - offsetX; const newY = touch.clientY - offsetY; menu.style.left = newX + "px"; menu.style.top = newY + "px"; localStorage.setItem("menuX", newX); localStorage.setItem("menuY", newY); } document.addEventListener("mouseup", stopDrag); document.addEventListener("touchend", stopDrag); function stopDrag(){ isDragging = false; }
window.addEventListener("scroll", function(){ const menu = document.getElementById("menu-container"); if(window.scrollY > 200){ menu.classList.add("show"); }else{ menu.classList.remove("show"); } });

hola muejeje (´-ω-)人( ´∀`)/~~☆⌒(*^∇゜)v ķkkkkkkkkkkkkkkkuuihugyygfgfgfgfgfgfgfg ghbghbgybg hjjbgyyunbgyjkkiuhtg ghbgt ghbgthnb hjbgyjbhyhhnhgyyuj hhgggfd ggbhnmkuyygyg hghghghghgh ughgubbuh ggnhjyjyhghgh ygyyghghgy hgghhg jkjhgtfdd fggvffd fgbhjiuyttrdd cfggnghhhh vbghggrtfgfgrr fbfgfgf hghtg lioiiou