How much does a website cost in 2026? Prices and comparison
Showcase site, e-commerce, custom build: how much should you budget for a website in 2026? Detailed prices, a comparison…
ReadCreate a circle that follows the cursor with javascript and css.
In some dark theme modes, a large cursor really helps identify the different elements on a page.
You can also highlight an element with a different color when the cursor is over it, which you can do with a regular cursor too. The end goal is to enlarge the cursor area.
Let's go
<div class='cursor' id="cursor"></div>
Pay attention to the mix-blend-mode property. Its value is set to difference, which works well for both dark and light modes.
.cursor {
position: fixed;
border-radius: 50%;
transform: translateX(-50%) translateY(-50%);
pointer-events: none;
left: -100px;
top: 50%;
mix-blend-mode: difference;
background-color: white;
z-index: 10000;
border: 2px solid white;
height: 30px;
width: 30px;
transition: all 300ms ease-out;
}
Now let's add an event listener on the body itself, which will keep track of the cursor position and adjust the position of the circle accordingly.
var cursor = document.getElementById("cursor");
document.body.addEventListener("mousemove", function(e) {
cursor.style.left = e.clientX + "px",
cursor.style.top = e.clientY + "px";
});
Website design, e-commerce or SEO: our web agency in Paris, Besançon and Normandy can help.
Free quoteShowcase site, e-commerce, custom build: how much should you budget for a website in 2026? Detailed prices, a comparison…
ReadStruggling to type an accented capital letter on Windows? Here is a complete guide to the Alt code shortcuts.…
ReadContext: we want to underline a text below the text. Modern CSS properties will help us: text-decoration-line: un…
Read