JSFiddle - React, Tailwind, and code Playground

HTML

<div class="text-mask">
    <div class="scrolling-text">MASKED TEXT</div>
</div>

CSS

body {
  background-color: #000;
}
.text-mask {
  font-size: 100px;
  font-weight: bold;
  background: linear-gradient(to right, orange 50%, white 50%);
  background-clip: text;
  color: transparent;
  position: relative;
  height: 120px;
}

.scrolling-text {
  /* transform: translateX(10px); */
  /* position: relative */
  
}

JavaScript

/* document.addEventListener('DOMContentLoaded', function() {
  const scrollingText = document.querySelector('.scrolling-text');
  let speed = 10;  // initial speed in seconds

  // Function to update animation speed
  function setScrollSpeed(newSpeed) {
    scrollingText.style.animationDuration = `${newSpeed}s`;
  }

  // Set initial scroll speed
  setScrollSpeed(speed);
}); */