Jump to content

Custom Cursor / Mouse

Recommended Posts

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!

Sin título.jpg

sdd.jpg

Link to comment
  • Replies 7
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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!

Sin título.jpg

sdd.jpg

I check that your cursor works properly now. Have you figured it out?

image.thumb.png.aa3ae038bd3e762f80c3955c40213068.png

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 Highlighter
If 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
1 hour ago, Beyondspace said:

I check that your cursor works properly now. Have you figured it out?

image.thumb.png.aa3ae038bd3e762f80c3955c40213068.png

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
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

image.png.bc372d3272260b1838a78821701844dd.png

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 Highlighter
If 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
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

image.png.bc372d3272260b1838a78821701844dd.png

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.

kkk.jpg

Edited by diegphoto
Link to comment

Try deleting this code

image.png.00ef8d8e80d575315da7c67a10f29fb5.png

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 Highlighter
If 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
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.