Avatar stack with mask

html #ui
<div>
  <span data-masked>
    <span style="background: black">
      <svg
        class="overflow-visible"
        role="img"
        viewBox="0 0 24 24"
        xmlns="http://www.w3.org/2000/svg"
      >
        <title>Vercel</title>
        <path
          d="M24 22.525H0l12-21.05 12 21.05z"
          class="-translate-y-0.5"
          fill="#fff"
        ></path>
      </svg>
    </span>
  </span>

  <span data-masked>
    <span style="background: red">
      <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
        <title>Uniqlo</title>
        <path
          fill="#fff"
          d="M0 .01v23.98h24V.01ZM4.291 3.29h4.553l.006 5.803h1.511v1.511h-6.82V9.094h3.783v-4.29H4.291zm10.11 0h5.302v1.514H14.4zm-.762 5.807h6.816v1.511H13.64zM4.29 13.385l6.072.002-1.513 7.322H2.777l.305-1.516h4.553l.892-4.29H5.49l-.457 2.148H3.521Zm9.348 0h6.816v7.324H13.64zm1.517 1.517v4.291h3.787v-4.29z"
        ></path>
      </svg>
    </span>
  </span>

  <span data-masked>
    <span style="background: #1ed760">
      <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
        <title>Spotify</title>
        <path
          fill="#fff"
          d="M12 0C5.4 0 0 5.4 0 12s5.4 12 12 12 12-5.4 12-12S18.66 0 12 0zm5.521 17.34c-.24.359-.66.48-1.021.24-2.82-1.74-6.36-2.101-10.561-1.141-.418.122-.779-.179-.899-.539-.12-.421.18-.78.54-.9 4.56-1.021 8.52-.6 11.64 1.32.42.18.479.659.301 1.02zm1.44-3.3c-.301.42-.841.6-1.262.3-3.239-1.98-8.159-2.58-11.939-1.38-.479.12-1.02-.12-1.14-.6-.12-.48.12-1.021.6-1.141C9.6 9.9 15 10.561 18.72 12.84c.361.181.54.78.241 1.2zm.12-3.36C15.24 8.4 8.82 8.16 5.16 9.301c-.6.179-1.2-.181-1.38-.721-.18-.601.18-1.2.72-1.381 4.26-1.26 11.28-1.02 15.721 1.621.539.3.719 1.02.419 1.56-.299.421-1.02.599-1.559.3z"
        ></path>
      </svg>
    </span>
  </span>

  <span data-masked>
    <span style="background: #06b6d4">
      <svg role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
        <title>Tailwind CSS</title>
        <path
          fill="#fff"
          d="M12.001,4.8c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 C13.666,10.618,15.027,12,18.001,12c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C16.337,6.182,14.976,4.8,12.001,4.8z M6.001,12c-3.2,0-5.2,1.6-6,4.8c1.2-1.6,2.6-2.2,4.2-1.8c0.913,0.228,1.565,0.89,2.288,1.624 c1.177,1.194,2.538,2.576,5.512,2.576c3.2,0,5.2-1.6,6-4.8c-1.2,1.6-2.6,2.2-4.2,1.8c-0.913-0.228-1.565-0.89-2.288-1.624 C10.337,13.382,8.976,12,6.001,12z"
        ></path>
      </svg>
    </span>
  </span>
</div>

<style>
  :root {
    --size: 48px;
    --border: 2px;
    --column: 32px;
  }

  div {
    display: grid;
    grid-template-columns: repeat(4, var(--column));
  }

  svg {
    width: 50%;
    height: 50%;
  }

  [data-masked] {
    position: relative;
    width: var(--size);
    aspect-ratio: 1 / 2;
    display: grid;
    align-items: flex-end;
  }

  [data-masked]:not(:first-of-type) {
    --circle: calc(((var(--border) * 2) + var(--size)) * 0.5);
    mask: radial-gradient(
        var(--circle) var(--circle) at
          calc(var(--circle) - var(--column) - var(--border)) 50%,
        #0000 var(--circle),
        #fff var(--circle)
      )
      0 calc(var(--size) * 0.5) / 100% 100%;
    transition: mask-position 0.2s;
  }

  [data-masked] > span {
    transition: translate 0.2s;
    display: inline-grid;
    border-radius: calc(1px * infinity);
    place-items: center;
    width: 100%;
    height: var(--size);
  }

  [data-masked]:hover span:first-of-type {
    translate: 0 -25%;
  }

  [data-masked]:hover + [data-masked] {
    mask-position: 0 calc(var(--size) * 0.25);
  }
</style>