mwg API
    Preparing search index...

    Function marqueeOffset

    • How far a line of textWidth is shifted to scroll inside boxWidth, time seconds in: it waits pause seconds, slides to its end at speed px/s, waits again, then slides back, over and over. A text that fits never moves.

      Parameters

      • textWidth: number
      • boxWidth: number
      • time: number
      • speed: number = 40
      • pause: number = 1

      Returns number

      import { marqueeOffset } from '@datamoc/mwg/two-d/ui';

      console.log(marqueeOffset(300, 200, 0)); // 0, waiting at the start
      console.log(marqueeOffset(300, 200, 3)); // 100, at the far end
      console.log(marqueeOffset(150, 200, 3)); // 0, it fits