Hey Bresh_store Hope you’re having a great day too!
You can totally create a hover effect that shows a soft light circle around the mouse when hovering over your Add to Cart button and we’ll make sure it works only on desktop. No app needed just a little custom code. Here’s a step-by-step guide (don’t worry, I’ve made it beginner-friendly):
How to do it (Step-by-Step)
1. Go to your Shopify Admin:
Online Store > Themes > … > Edit Code
2. Open the file:
Assets > base.css (or theme.css if you don’t see base.css)
Scroll to the bottom and paste this CSS:
@media screen and (min-width: 768px) {
.custom-cursor {
position: fixed;
width: 80px;
height: 80px;
background: rgba(255, 255, 255, 0.2);
border-radius: 50%;
pointer-events: none;
transform: translate(-50%, -50%);
z-index: 9999;
transition: opacity 0.3s ease;
opacity: 0;
}
.add-to-cart-hovered .custom-cursor {
opacity: 1;
}
}
3. Now open:
Layout > theme.liquid
Scroll to the very bottom and paste this right before </body>:
<script>
document.addEventListener("DOMContentLoaded", function () {
const cursor = document.createElement("div");
cursor.classList.add("custom-cursor");
document.body.appendChild(cursor);
const updateCursorPosition = (e) => {
cursor.style.left = e.clientX + "px";
cursor.style.top = e.clientY + "px";
};
document.addEventListener("mousemove", updateCursorPosition);
const addToCartButtons = document.querySelectorAll('form[action*="/cart/add"] button[type="submit"]');
addToCartButtons.forEach((btn) => {
btn.addEventListener("mouseenter", () => {
document.body.classList.add("add-to-cart-hovered");
});
btn.addEventListener("mouseleave", () => {
document.body.classList.remove("add-to-cart-hovered");
});
});
});
</script>
Now when you hover your Add to Cart button on desktop, you’ll see a nice soft light circle following the mouse.
If you’d like to tweak the color, size, or even add animation just let me know and I’ll help you fine-tune it.
If you’d ever like someone to handle these tweaks directly in your theme or help with more advanced stuff, feel free to DM me I specialize in Shopify customizations and I’m happy to support store owners like you!
Let me know how it goes
Happy building