.page
  .section-1
    .card-holder
      .card
        .title Hello
        .subtitle Scroll down ↓

  .section-2
    h2 Section #2
    p text text text text
View Compiled
body {
  padding: 0;
  margin: 0;
}

.page {
  height: 200vh;
  background-color: black;
  height: auto;
}

.card-holder {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  margin-bottom: 2em;
}

.section-1 {
  min-height: 150vh;
}

.section-2 {
  min-height: 100vh;
  background-color: rebeccapurple;
  padding: 2em;
  color: white;
  box-sizing: border-box;
}

.card {
  background-color: crimson;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;

  border: 0.5rem solid white;
  border-radius: 40px;
  box-sizing: border-box;
  transition: all 0.01s ease;
  transform-origin: bottom;

  .title {
    display: block;
    font-size: 5em;
    color: white;
  }

  .subtitle {
    color: white;
    font-size: 3em;
    display: block;
  }
}
View Compiled
const card = document.querySelector(".card");
const cardTitle = card.querySelector(".title");

window.addEventListener("scroll", () => {
  const scroll = window.scrollY;
  const max = window.innerHeight;

  const scale = (max - scroll) / max;

  if (scale >= 0.2) {
    card.style.transform = `scale(${scale})`;
  }
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.