Back to the library

Fluid — buoyant settle

Variant: Buoyant settle

A chip dropped into a basin: a true t² fall, a plunge past its float line, then four half-swings that shrink 8.7 → 2.7 → 1 → 0.4px about a rest 11px deep. The plunge’s curve enters at the falling chip’s own speed, so the water takes the motion over instead of restarting it. Every swing keeps the same 340ms half period while only the height decays — what a damped body does, and what a chain of separately eased bounces never does. The level rides the same keyframes, rising by exactly the chip’s displaced volume against a mark on the wall, so depth reads without a number. Reach for it when a drop target should feel like it received something with weight — an upload well, a tray, a cart — and the settle is the acknowledgement.

physicsentrancegestureloop

The source

A complete HTML document. Paste it into an empty .html file and it plays — no stylesheet, script, font, or image to fetch.

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Fluid — buoyant settle</title>
    <style>
      :root {
        /* Neutrals — fixed, never remixed. */
        --ivory: #faf9f5;
        --paper: #ffffff;
        --oat: #e3dacc;
        --slate: #141413;

        /* Knobs — the remix API. A knob exists iff declared here and used below. */
        --hue: 38.8;
        --lift: 0;
        --chroma: 1;
        --round: 1;
        --speed: 1;

        /* Accents — derived from the knobs with the family's offsets baked in,
           so one hue roll moves them together. Defaults reproduce the original hex. */
        --clay: oklch(calc(0.6724 + var(--lift)) calc(0.1308 * var(--chroma)) var(--hue));
        --clay-d: oklch(calc(0.5797 + var(--lift)) calc(0.127 * var(--chroma)) var(--hue));
        --olive: oklch(
          calc(0.6118 + var(--lift)) calc(0.0713 * var(--chroma)) calc(var(--hue) + 88.3)
        );
        --rust: oklch(
          calc(0.5408 + var(--lift)) calc(0.1357 * var(--chroma)) calc(var(--hue) - 10.3)
        );

        /* Clock — every duration in the document runs off --t. */
        --cycle: 3.6s;
        --t: calc(var(--cycle) / var(--speed));

        --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
        /* Water drag. The entry slope (9.8) is the falling chip's own speed, so
           the plunge continues the fall instead of restarting it — then the
           curve spends nearly all of its 300ms bleeding that speed away. */
        --ease-accent: cubic-bezier(0.1, 0.98, 0.3, 1);

        --_water: color-mix(in oklch, var(--olive) 32%, transparent);
        --_water-lo: color-mix(in oklch, var(--olive) 20%, transparent);
        --_cue: color-mix(in oklch, var(--slate) 30%, var(--ivory));
      }

      * {
        box-sizing: border-box;
        margin: 0;
        padding: 0;
      }

      body {
        min-height: 100vh;
        display: grid;
        place-items: center;
        background: var(--ivory);
        font-family:
          system-ui,
          -apple-system,
          'Segoe UI',
          Roboto,
          sans-serif;
        color: var(--slate);
      }

      .stage {
        position: relative;
        width: 220px;
        height: 190px;
      }

      .basin {
        position: absolute;
        left: 50px;
        top: 72px;
        width: 120px;
        height: 108px;
        border-radius: 0 0 calc(12px * var(--round)) calc(12px * var(--round));
      }

      /* The basin's floor sits behind the chip and its water in front of it,
         so the submerged part of the chip reads tinted, not hidden. */
      .back {
        background: var(--paper);
      }

      /* Walls drawn last, over the water, so the waterline meets them cleanly. */
      .basin:not(.back)::after {
        content: '';
        position: absolute;
        inset: 0;
        border: 1.5px solid var(--oat);
        border-top: 0;
        border-radius: inherit;
      }

      /* Where the water stood before anything was in it. The rise is the
         chip's displaced volume spread over the basin's width, so it is the
         only honest readout of how deep the chip is sitting. */
      .mark {
        position: absolute;
        left: -15px;
        top: 47px;
        width: 12px;
        height: 1.5px;
        background: var(--_cue);
      }

      .pool {
        position: absolute;
        inset: 0;
        overflow: hidden;
        border-radius: inherit;
      }

      .water {
        position: absolute;
        left: 0;
        right: 0;
        top: 48px;
        height: 72px;
        background: var(--_water);
        border-top: 1.5px solid var(--olive);
        animation: level var(--t) infinite;
      }

      .crest {
        position: absolute;
        left: 50%;
        top: -3px;
        width: 12px;
        height: 4px;
        margin-left: -6px;
        border-radius: 50%;
        background: var(--olive);
        opacity: 0;
        animation: crest-l var(--t) linear infinite;
      }

      .crest + .crest {
        animation-name: crest-r;
      }

      .chip {
        position: absolute;
        left: 82px;
        top: 0;
        width: 56px;
        height: 22px;
        border-radius: calc(4px * var(--round));
        background: var(--paper);
        border: 1.5px solid var(--oat);
        border-left: 4px solid var(--clay);
        animation: ride var(--t) infinite;
      }

      /* Chip positions, solved from the water it displaces: a half-density
         chip rests 11px deep, and every pixel it sinks lifts the level by
         56/120 of a pixel. Fall is a true parabola (t², 380ms); every swing
         after the plunge keeps the same 340ms half period while the
         amplitude about rest falls 8.7 → 2.7 → 1 → 0.4px — a damping ratio
         near 0.3, which lets water look thick without looking like syrup. */
      @keyframes ride {
        0% {
          transform: translateY(8px);
          opacity: 0;
          animation-timing-function: var(--ease-out);
        }
        5.5%,
        11.1% {
          transform: translateY(8px);
          opacity: 1;
          animation-timing-function: cubic-bezier(0.333, 0, 0.667, 0.333);
        }
        21.67% {
          transform: translateY(98px);
          animation-timing-function: var(--ease-accent);
        }
        30% {
          transform: translateY(112.53px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        39.44% {
          transform: translateY(101.15px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        48.89% {
          transform: translateY(104.88px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        58.33% {
          transform: translateY(103.49px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        67.78%,
        88.9% {
          transform: translateY(103.87px);
          opacity: 1;
          animation-timing-function: var(--ease-out);
        }
        93% {
          transform: translateY(103.87px);
          opacity: 0;
        }
        93.1%,
        100% {
          transform: translateY(8px);
          opacity: 0;
        }
      }

      /* The level rides the same keyframes and curves as the chip: while it
         is partly submerged, rise is linear in depth, so one easing serves
         both and the two can never disagree. */
      @keyframes level {
        0%,
        21.67% {
          transform: translateY(0);
          animation-timing-function: var(--ease-accent);
        }
        30% {
          transform: translateY(-10.27px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        39.44% {
          transform: translateY(-2.75px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        48.89% {
          transform: translateY(-6.02px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        58.33% {
          transform: translateY(-4.81px);
          animation-timing-function: cubic-bezier(0.37, 0, 0.63, 1);
        }
        67.78%,
        93% {
          transform: translateY(-5.13px);
          animation-timing-function: var(--ease-out);
        }
        98%,
        100% {
          transform: translateY(0);
        }
      }

      /* Surface waves travel at constant speed and lose height as they go,
         so the motion is linear and only the opacity decays. */
      @keyframes crest-l {
        0%,
        21.6% {
          transform: translateX(0) scaleX(0.6);
          opacity: 0;
        }
        22.4% {
          transform: translateX(-3px) scaleX(1);
          opacity: 0.9;
        }
        38.3%,
        100% {
          transform: translateX(-46px) scaleX(1);
          opacity: 0;
        }
      }

      @keyframes crest-r {
        0%,
        21.6% {
          transform: translateX(0) scaleX(0.6);
          opacity: 0;
        }
        22.4% {
          transform: translateX(3px) scaleX(1);
          opacity: 0.9;
        }
        38.3%,
        100% {
          transform: translateX(46px) scaleX(1);
          opacity: 0;
        }
      }

      @media (prefers-reduced-motion: reduce) {
        /* The fall and the bob are travel, so they go. What stays is the
           settled fact — the chip floating at its draft, the level risen
           above the mark — with the water's tint slowly breathing. */
        .chip {
          animation: none;
          transform: translateY(103.87px);
        }

        .crest {
          animation: none;
        }

        .water {
          transform: translateY(-5.13px);
          animation: still calc(var(--t) * 2) ease-in-out infinite;
        }

        @keyframes still {
          0%,
          100% {
            background-color: var(--_water);
          }
          50% {
            background-color: var(--_water-lo);
          }
        }
      }
    </style>
  </head>
  <body>
    <div
      class="stage"
      role="img"
      aria-label="A chip drops into a basin of water, plunges, bobs twice and floats at its resting depth while the water level rises by what it displaces"
    >
      <div class="basin back"></div>
      <div class="chip"></div>
      <div class="basin">
        <div class="mark"></div>
        <div class="pool">
          <div class="water">
            <div class="crest"></div>
            <div class="crest"></div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

The variant family

Same idea, one axis moved. Compare them side by side before you commit.