Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

235
Views
how do i style some part of the shape in hover?

the bigger circle is the mouse cursor and the small one is a fixed circle in the center of the page, how can style this circle like the image when the cursor touches some area of the center circle? enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Here is a simple example of a large circle being used like the cursor and using mix-blend-mode difference.

The background of the container is blue (#0000ff) and the circles are yellow (#ffff00) so that the difference is white (#ffffff).

When the circles overlap the difference is #000000 and that differenced with blue is blue.

<!doctype html>
<html>

<head>
  <title>Circles</title>
  <style>
    .bg {
      width: 100vw;
      height: 100vh;
      background: blue;
      mix-blend-mode: difference;
      cursor: none;
      position: fixed;
      top: 0;
      left: 0;
    }
    
    .fixedcircle {
      width: 100px;
      height: 100px;
      background: yellow;
      border-radius: 50%;
      top: calc(50% - 50px);
      left: calc(50% - 50px);
      position: relative;
      position: fixed;
      mix-blend-mode: difference;
    }
    
    .cursor {
      width: 200px;
      height: 200px;
      border-radius: 50%;
      background: yellow;
      position: absolute;
      mix-blend-mode: difference;
    }
  </style>
</head>

<body>
  <div class="bg"></div>
  <div class="fixedcircle"></div>
  <script>
    const cursor = document.createElement('div');
    cursor.classList.add('cursor');
    document.body.append(cursor);
    document.body.addEventListener('mousemove', function() {
      cursor.style.top = (event.clientY - 100) + 'px';
      cursor.style.left = (event.clientX - 100) + 'px';
    });
  </script>
</body>

</html>

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!