<tosi-interpolator>

Declarative CSS-property interpolation between scroll waypoints. Wrap any element, add <tosi-waypoint progress="…" style="…"> children, and each style property is blended (numbers per-number, colours via color-mix) as the enclosing <tosi-product-section>'s pin progress runs 0 → 1.

A property animates when every waypoint writes it in the same shape: the same transform functions in the same order, with the same units (a bare 0 adopts the other side's unit). translateY(0px) → scale(1.2) has no in-between, so it steps at the midpoint; write translateY(0px) scale(1) → translateY(0px) scale(1.2) instead.

The panel below is a live <tosi-interpolator> — scroll it, then read its markup in Source view (top-right). No JavaScript; it is the HTML shown here.

Scroll me

Attributes

<tosi-interpolator>

<tosi-waypoint>

Editable example

<tosi-product>
  <tosi-product-section scroll="150">
    <tosi-interpolator data-scroll-animate easing="ease-in-out">
      <tosi-waypoint progress="0" style="opacity:0; transform: translateX(-80px)"></tosi-waypoint>
      <tosi-waypoint progress="1" style="opacity:1; transform: translateX(0)"></tosi-waypoint>
      <h1>Edit me</h1>
    </tosi-interpolator>
  </tosi-product-section>
</tosi-product>

See also <tosi-product> and <tosi-filmstrip>.