YJC Posted September 19, 2020 Share Posted September 19, 2020 (edited) Hi, I wonder how to make a mouse cursor like this? http://www.gabbyguenther.com/ I want to change my mouse cursor, but not image url. I am still new to coding and squarespace. I would appreciate if anyone can help!! Edited September 19, 2020 by YJC Link to comment
tuanphan Posted September 21, 2020 Share Posted September 21, 2020 They used this code (Add to Home > Settings > Advanced > Code injection > Header) <style> @media (hover: none) {.cursor {display:none !important;}} * { cursor: none; --cursorcolors: #d9a74a; } .cursor { --size: 8px; height: var(--size); width: var(--size); border-radius: 50%; position: absolute; z-index: 99999999999; transform: translate(-50%, -50%); pointer-events: none; } .cursor.cursor-ring { background-color: transparent; border: 2px solid var(--cursorcolors); --size: 36px; transition: top .2s, left .2s, width .2s, height .2s, background-color .2s, border-color 0.2s; transition-timing-function: ease-out; } .cursor.cursor-bull { background: var(--cursorcolors); transition: width .2s, height .2s; } .cursor-ring.active { --size: 42px; border-color: var(--cursorcolors); background-color: var(--cursorcolors); } .cursor-bull.active { --size: 0; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(window).mousemove(function(e) { $(".cursor").css({ left: e.pageX, top: e.pageY }) }); $(window).mousemove(function(e) { $("a") .on("mouseenter", function() { $('.cursor').addClass("active") }) }); $(window).mousemove(function(e) { $("a") .on("mouseleave", function() { $('.cursor').removeClass("active") }) }); </script> melissagaviria 1 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care Link to comment
willfromtexas Posted March 23, 2021 Share Posted March 23, 2021 On 9/21/2020 at 9:50 AM, tuanphan said: They used this code (Add to Home > Settings > Advanced > Code injection > Header) <style> @media (hover: none) {.cursor {display:none !important;}} * { cursor: none; --cursorcolors: #d9a74a; } .cursor { --size: 8px; height: var(--size); width: var(--size); border-radius: 50%; position: absolute; z-index: 99999999999; transform: translate(-50%, -50%); pointer-events: none; } .cursor.cursor-ring { background-color: transparent; border: 2px solid var(--cursorcolors); --size: 36px; transition: top .2s, left .2s, width .2s, height .2s, background-color .2s, border-color 0.2s; transition-timing-function: ease-out; } .cursor.cursor-bull { background: var(--cursorcolors); transition: width .2s, height .2s; } .cursor-ring.active { --size: 42px; border-color: var(--cursorcolors); background-color: var(--cursorcolors); } .cursor-bull.active { --size: 0; } </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(window).mousemove(function(e) { $(".cursor").css({ left: e.pageX, top: e.pageY }) }); $(window).mousemove(function(e) { $("a") .on("mouseenter", function() { $('.cursor').addClass("active") }) }); $(window).mousemove(function(e) { $("a") .on("mouseleave", function() { $('.cursor').removeClass("active") }) }); </script> @tuanphan Is there a way to lock this effect to the cursor on scroll? I have it coded in correctly, but the effect gets left behind when I scroll. How do I fix this? www.pollenmedialab.com Thank you! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment