section.container
  h1 Natural perspective change on scroll 
  .row
    img(src="https://picsum.photos/400")
    img(src="https://picsum.photos/420")
    img(src="https://picsum.photos/430")
    img(src="https://picsum.photos/440")
    img(src="https://picsum.photos/450")
    img(src="https://picsum.photos/460")
    img(src="https://picsum.photos/470")
    img(src="https://picsum.photos/480")
    img(src="https://picsum.photos/490")
    img(src="https://picsum.photos/500")
View Compiled
$begin-part-matrix: 1, 0, 0;
$middle-part-matrix: 0, 1, 0;
$last-part-matrix: 1, 1, 0, 3;
* {
  font-family: Helvetica, sans-serif;
}

body {
  margin: 0;
}

.container {
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: visible;
  perspective: 45vw;
  perspective-origin: center center;
}

h1 {
  position: sticky;
  left: calc(100vw / 24);
  font-size: 2rem;
  font-weight: 500;
  width: 80vw;
}

.row {
  position: relative;
  display: flex;
  align-items: center;
  width: max-content;
  padding: 1.5rem;
  img {
    transform-style: preserve-3d;
    transform-origin: center;
    pointer-events: all;
    width: 50vw;
    height: 50vw;
    @media (max-width: 750px) {
     width: 300px;
     height: 300px;
    }
    object-fit: cover;
    // scroll-snap-align: start;
    transition: 0.4s ease-out;
    clip-path: inset(0 0 0 0);
    // &:hover {
    //   clip-path: inset(10px 10px 10px 10px);
    // }
    @for $i from 0 to 100 {
      &:nth-of-type(#{$i + 1}) {
        transform: translateZ($i * -400px) translateX(400px * $i) rotateY(1deg * $i);
      }
    }
  }
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.