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? Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, 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 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, 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 Greeting, it's BeyondSpace, I am Squarespace dev focus on provide solutions to enhance feature that squarespace.com can't provide.Feel free to check my current Squarespace Plugins Developement: Enable Pinch/Zoom on lightbox, Delivery Date Picker, Keyword HighlighterIf you find my answer fit your need, 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 Author Share Posted January 3 @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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment