T E C H D E V E R S
enpix

Join a community of more than 1,50,000+ persons,get the most out of it.

document.addEventListener("DOMContentLoaded", function () { // Create cursor div const cursor = document.createElement("div"); cursor.classList.add("custom-cursor"); document.body.appendChild(cursor); // Move cursor with mouse document.addEventListener("mousemove", function (e) { cursor.style.top = e.clientY + "px"; cursor.style.left = e.clientX + "px"; }); // Add hover effect const hoverTargets = document.querySelectorAll("a, button"); hoverTargets.forEach((el) => { el.addEventListener("mouseenter", () => { cursor.style.transform = "translate(-50%, -50%) scale(1.8)"; cursor.style.backgroundColor = "rgba(0, 0, 0, 0.3)"; }); el.addEventListener("mouseleave", () => { cursor.style.transform = "translate(-50%, -50%) scale(1)"; cursor.style.backgroundColor = "rgba(0, 0, 0, 0.1)"; }); }); });