diegphoto Posted December 20, 2022 Share Posted December 20, 2022 Hi!, I have the code to change the cursor of my web page, but now I need that when the cursor is over a category or text it hovers. The effect I want is similar to this page https://rafalbojar.com/ . I also attach files of how the effect looks. My website is https://www.diegphoto.com/ and the code that I already used is this: body, html, * { cursor: url(https://static1.squarespace.com/static/62ec9420d1df13083dc8f4ad/t/63a1bdedcf2ca4775ddbddbe/1671544301258/orange-circlepeque%C3%B1o2.png), auto !important; } Thank you in advance! Link to comment
Beyondspace Posted December 21, 2022 Share Posted December 21, 2022 20 hours ago, diegphoto said: Hi!, I have the code to change the cursor of my web page, but now I need that when the cursor is over a category or text it hovers. The effect I want is similar to this page https://rafalbojar.com/ . I also attach files of how the effect looks. My website is https://www.diegphoto.com/ and the code that I already used is this: body, html, * { cursor: url(https://static1.squarespace.com/static/62ec9420d1df13083dc8f4ad/t/63a1bdedcf2ca4775ddbddbe/1671544301258/orange-circlepeque%C3%B1o2.png), auto !important; } Thank you in advance! I check that your cursor works properly now. Have you figured it out? BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
diegphoto Posted December 21, 2022 Author Share Posted December 21, 2022 1 hour ago, Beyondspace said: I check that your cursor works properly now. Have you figured it out? I find in the forum another code that it has the hover effect. The problem is that the hover doesn't work in button forms. also when the cursor is on the white background of the contact form, it disappears. The page is https://www.diegphoto.com/contacto Here is the new code In Design > Custom CSS @media ( hover: none ) { .cursor { display: none !important; } } * { cursor: none; } .cursor { --size: 10px; height: var( --size ); width: var( --size ); border-radius: 50%; pointer-events: none; position: absolute; transform: translate( -50%, -50% ); z-index: 99999999999; } .cursor.cursor-dot { background: #ed4c00; /* This defines the color of the cursor */ mix-blend-mode: screen; /* Delete this line if you dont want the circle to invert */ transition: width 0.6s, height 0.6s, background-color 0.6s; transition-timing-function: ease-out; } .cursor-dot.active { --size: 50px; background-color: #ed4c00; } In Settings > Advanced > Code Injection > HEADER. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> In Settings > Advanced > Code Injection > FOOTER. <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( 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> Thank you! Link to comment
Beyondspace Posted December 21, 2022 Share Posted December 21, 2022 5 minutes ago, diegphoto said: I find in the forum another code that it has the hover effect. The problem is that the hover doesn't work in button forms. also when the cursor is on the white background of the contact form, it disappears. The page is https://www.diegphoto.com/contacto Here is the new code In Design > Custom CSS @media ( hover: none ) { .cursor { display: none !important; } } * { cursor: none; } .cursor { --size: 10px; height: var( --size ); width: var( --size ); border-radius: 50%; pointer-events: none; position: absolute; transform: translate( -50%, -50% ); z-index: 99999999999; } .cursor.cursor-dot { background: #ed4c00; /* This defines the color of the cursor */ mix-blend-mode: screen; /* Delete this line if you dont want the circle to invert */ transition: width 0.6s, height 0.6s, background-color 0.6s; transition-timing-function: ease-out; } .cursor-dot.active { --size: 50px; background-color: #ed4c00; } In Settings > Advanced > Code Injection > HEADER. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> In Settings > Advanced > Code Injection > FOOTER. <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( 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> Thank you! Try modifying a little on your above code <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( window ).mousemove ( function ( e ) { $( '.cursor' ).css ( { left: e.pageX, top: e.pageY } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseenter', function ( ) { $( '.cursor' ).addClass ( 'active' ); } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseleave', function ( ) { $( '.cursor' ).removeClass ( 'active' ); } ); } ); } ); </script> This is the difference between the previous code with new Hope it makes sense BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
diegphoto Posted December 21, 2022 Author Share Posted December 21, 2022 (edited) 9 minutes ago, Beyondspace said: Try modifying a little on your above code <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( window ).mousemove ( function ( e ) { $( '.cursor' ).css ( { left: e.pageX, top: e.pageY } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseenter', function ( ) { $( '.cursor' ).addClass ( 'active' ); } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseleave', function ( ) { $( '.cursor' ).removeClass ( 'active' ); } ); } ); } ); </script> This is the difference between the previous code with new Hope it makes sense Yes! That solves the problem with form buttons. But there is still the problem that the mouse disappears on the white background of the contact. I think the problem is the 'mix-blend-mode: screen' but I don't know the solution. I think it does not disappear but looks very transparent. Edited December 21, 2022 by diegphoto Link to comment
Beyondspace Posted December 21, 2022 Share Posted December 21, 2022 Try deleting this code BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox, video lightbox and much more) 🗓️ Delivery Date Picker (Squarespace Date picker form field) 💫 Gallery block 7.1 workaround 🥳 No-code customisations for Squarespace (+100 Spark plugin customisations) 🥳 Freemium Squarespace Widget Templates (+1000 Elfsight Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
diegphoto Posted December 21, 2022 Author Share Posted December 21, 2022 (edited) 8 hours ago, Beyondspace said: Try deleting this code It solves the problem but now the hover effect is opaque. I also noticed that the hover effect of the mouse don't work in lightbox. Edited December 22, 2022 by diegphoto Link to comment
diegphoto Posted January 3, 2023 Author Share Posted January 3, 2023 @Beyondspace I have figured out how to fix the hover effect. The only thing that is missing is when you are viewing an image in the lightbox, the hover effect doesn't work in the arrows and the x. Thank you! Link to comment
TJC123 Posted April 18, 2023 Share Posted April 18, 2023 (edited) Hi, I have tried to use your codes above but the standard "hand" cursor is visible when hovering over navigation, how can I fix this? I also want the colour change to be gradual and smooth like the cursor size transition, now it just changes instantly. How can I achieve this?@Beyondspace Thanks! Edited April 18, 2023 by TJC123 Link to comment
tuanphan Posted April 22, 2023 Share Posted April 22, 2023 On 4/18/2023 at 9:51 PM, TJC123 said: Hi, I have tried to use your codes above but the standard "hand" cursor is visible when hovering over navigation, how can I fix this? I also want the colour change to be gradual and smooth like the cursor size transition, now it just changes instantly. How can I achieve this? Thanks! What is your site url? We can check easier Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
KyleKeigan Posted December 21, 2023 Share Posted December 21, 2023 @tuanphan Hi! Same issue as @TJC123 I successfully used the above code for a custom cursor on my site but the pointer cursor is appearing over most of my links. It doesn't appear when hovering over the logo and social icons but I think those are the only spots. I played around with adding this code but it changes it back to the arrow instead: .header-nav *, nav.header-menu-nav-list * { cursor: default !important; } Website URL: https://sunfish-turbot-cxel.squarespace.com/ Thank you!!! Link to comment
tuanphan Posted December 22, 2023 Share Posted December 22, 2023 On 12/21/2023 at 12:18 PM, KyleKeigan said: @tuanphan Hi! Same issue as @TJC123 I successfully used the above code for a custom cursor on my site but the pointer cursor is appearing over most of my links. It doesn't appear when hovering over the logo and social icons but I think those are the only spots. I played around with adding this code but it changes it back to the arrow instead: .header-nav *, nav.header-menu-nav-list * { cursor: default !important; } Website URL: https://sunfish-turbot-cxel.squarespace.com/ Thank you!!! Which exact code did you use? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
KyleKeigan Posted December 22, 2023 Share Posted December 22, 2023 @tuanphan Design > Cusom CSS @media ( hover: none ) { .cursor { display: none !important; } } * { cursor: none; } .cursor { --size: 10px; height: var( --size ); width: var( --size ); border-radius: 50%; pointer-events: none; position: absolute; transform: translate( -50%, -50% ); z-index: 99999999999; } .cursor.cursor-dot { background: #ed4c00; /* This defines the color of the cursor */ mix-blend-mode: screen; /* Delete this line if you dont want the circle to invert */ transition: width 0.6s, height 0.6s, background-color 0.6s; transition-timing-function: ease-out; } .cursor-dot.active { --size: 50px; background-color: #ed4c00; } In Settings > Advanced > Code Injection > HEADER. <script src="//ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> In Settings > Advanced > Code Injection > FOOTER. <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( window ).mousemove ( function ( e ) { $( '.cursor' ).css ( { left: e.pageX, top: e.pageY } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseenter', function ( ) { $( '.cursor' ).addClass ( 'active' ); } ); } ); $( window ).mousemove ( function ( e ) { $( 'a, input.button' ).on ( 'mouseleave', function ( ) { $( '.cursor' ).removeClass ( 'active' ); } ); } ); } ); </script> moonlitdesign 1 Link to comment
KyleKeigan Posted December 29, 2023 Share Posted December 29, 2023 @tuanphan I solved this using another thread: I changed this code: In Settings > Advanced > Code Injection > FOOTER. (slight difference and I don't necessarily think this is where the problem was) <script> $( ( ) => { $( 'body' ).prepend ( '<div class="cursor cursor-dot" style="left: 0px; top: 0px;">' ); $( 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> And in Design > Custom CSS added: * { cursor: none !important; } moonlitdesign 1 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