Hacker News new | ask | show | jobs
by dag11 888 days ago
Unrelated to the article directly, it's kinda neat that the site's text selection highlight color is randomized on every mousedown.
5 comments

  /* Text Higlight Color /**/
  :root {
    --highlight-color: null;
  }

  ::selection {
    background: var(--highlight-color);
    color:#FFFFFF;
  }
  ::-moz-selection { /* Code for Firefox */
    color: #FFFFFF;
    background: var(--highlight-color);
  }
  </style>

  <!-- Text Highlight -->
  <script>
    const colors = ["#F76808", "#30A46C", "#0091FF", "#6E56CF", "#E5484D"];
    window.addEventListener("mousedown", (e) => {
      const color = colors.shift();
      document.documentElement.style.setProperty("--highlight-color", color);
      colors.push(color);
    });
  </script>
Josh on our team is so happy people discovered and liked his easter egg!
On the other hand, as someone with ADHD who is easily distracted, I couldn't even finish reading the article. Those GIFs are super annoying and don't play once, no they play again and again.

Sad, because it sounded interesting, but no way I could focus enough to actually comprehend it.

However, setting the highlight color to pure white in the CSS isn't very nice for people who load the page with JavaScript disabled.
I'm ashamed to admit that I spent more time highlighting random snippets of text than I did reading the article.
I went back just to see and it chose WHITE as the first option, making the text invisible lol
Just curious, what browser? This seems to be a bug.
Chrome, nothing special on it
did cursor-fidgeting-while-reading lead to this discovery?
I used to do this, I had to retire several mice because the underneath of the left mouse button was worn away from hitting the micro-switch so much..