s72
  • Count

    data-count since 0.1.0

    data-count on an element makes the first number in its text count up from zero, once, when it scrolls into view. Separators, decimals and the words around the number are kept.

    Basic

    Pages built1,204in 2.4 seconds
    Commits this week49across four repositories
    Focus time14.5 hMonday to this morning
    html
    <div data-grid="3">
      <article><small>Pages built</small><strong data-count>1,204</strong><span>in 2.4 seconds</span></article>
      <article><small>Commits this week</small><strong data-count>49</strong><span>across four repositories</span></article>
      <article><small>Focus time</small><strong data-count>14.5 h</strong><span>Monday to this morning</span></article>
    </div>

    14.5 h keeps its decimal and its unit; 1,204 keeps its comma.

    Notes