Skip to content
  • Recent
  • Tags
  • Popular
  • Users
  • Search
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse

Lay Theme Forum

  1. Home
  2. General Discussion
  3. Reactive/negative text – text reacting to the background

Reactive/negative text – text reacting to the background

Scheduled Pinned Locked Moved General Discussion
7 Posts 3 Posters 843 Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K
    K
    K_Rim
    wrote on last edited by
    #1

    Hey Everyone,

    I saw some websites using text that reacts to what is behind.
    Additional to that, i once also saw cursors doing that.

    Do you have any clue on how to achieve that effect?

    I'd like to implement it to my menu and some text.

    https://visual-space-agency.com/overview/

    https://leandrodisler.com/

    Thank you in advance :)

    Gross.jpeg

    Bildschirmfoto 2025-03-01 um 18.35.49.jpg

    1 Reply Last reply
    0
    • P
      P
      piotr
      wrote on last edited by
      #2

      Hi there

      I implemented it in my menu, have a look here:

      http://laythemeforum.com/topic/10673/menu-text-color-change-when-overlapping-with-images

      Don't know how to do it to the cursor though

      1 Reply Last reply
      0
      • arminunruhA
        arminunruhA
        arminunruh
        Global Moderator
        wrote on last edited by
        #3

        Hey there, so what happens here is people use CSS called mixed blend mode difference, and the text has to be white for it to work.

        https://www.instagram.com/p/Cjm8eHkjiXA/

        I once did a reel about this that you can see here.

        1 Reply Last reply
        0
        • arminunruhA
          arminunruhA
          arminunruh
          Global Moderator
          wrote on last edited by arminunruh
          #4

          If people use cursors with this effect, then they are using an HTML element as a cursor. This HTML element is white and needs to use the mix-blend-mode effect too. It uses JavaScript to update its position.

          For example, if you go to ChatGPT and use this prompt:
          "Can you tell me the HTML code, the CSS code and the JavaScript code I need to have a cursor that uses Mix Blend Mode Difference? The cursor should be an HTML element that updates its position using JavaScript. "

          You will get a pretty good answer

          This is from that answer, and I'm just changing the answer a little to make it more applicable to Lay Theme. Go to Lay Theme Custom CSS and HTML. And then in HTML at the top insert:

          <div class="custom-cursor" id="customCursor"></div>
          

          In Custom CSS insert:

          body {
            cursor: none; /* Hide the default cursor */
          }
          /* Custom cursor styling */
          .custom-cursor {
            position: fixed;
            top: 0;
            left: 0;
            width: 20px;
            height: 20px;
            background-color: white;
            border-radius: 50%;
            pointer-events: none;
            mix-blend-mode: difference;
            transition: transform 0.05s ease-out;
            z-index: 9999;
          }
          

          In Custom HTML at Bottom, Insert:

          <script>
          const cursor = document.getElementById('customCursor');
          
          document.addEventListener('mousemove', (e) => {
            cursor.style.transform = `translate(${e.clientX - 10}px, ${e.clientY - 10}px)`;
          });
          </script>
          

          How it works:
          The default cursor is hidden (cursor: none).

          A white circular div follows the mouse.

          mix-blend-mode: difference causes the white cursor to invert the background color underneath it — this creates a dynamic effect against light or dark backgrounds.

          1 Reply Last reply
          0
          • arminunruhA
            arminunruhA
            arminunruh
            Global Moderator
            wrote on last edited by
            #5

            Screenshot 2025-05-12 at 10.16.05.png

            Here you can see the result.

            1 Reply Last reply
            0
            • arminunruhA
              arminunruhA
              arminunruh
              Global Moderator
              wrote on last edited by
              #6

              http://laythemeforum.com/topic/6161/cursor-invert-color-black-white-text/19

              Actually, I already wrote a tutorial for this in the link above.

              1 Reply Last reply
              0
              • K
                K
                K_Rim
                wrote on last edited by
                #7

                @arminunruh Hey man,

                Thank you so much! It was a big help and everything works as intended :)

                Also thanks to @piotr for telling me about your topic :)

                Enjoy your weeks

                1 Reply Last reply
                0

                Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                With your input, this post could be even better 💗

                Register Login
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                Online Users
                I
                itsbadjujuju
                Forgot your key, lost your files, need a previous Lay Theme or Addon version? Go to www.laykeymanager.com
                laytheme.com
                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Recent
                • Tags
                • Popular
                • Users
                • Search