Scroll · 05 of 34
Scale Up
Content grows from slightly smaller than final size while fading in, which draws focus without feeling like a bounce. A single scale transform on an ease-out.
<section class="scale-up-section">
<h2>Scale Up</h2>
</section>
.scale-up-section {
min-height: 35vh;
display: flex;
align-items: center;
justify-content: center;
}
.scale-up-section h2 {
font-size: 2.5rem;
color: #f0f0f5;
opacity: 0;
transform: scale(0.7);
transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.scale-up-section.in-view h2 {
opacity: 1;
transform: scale(1);
}
var section = document.querySelector('.scale-up-section');
new IntersectionObserver(function (entries) {
entries.forEach(function (entry) {
entry.target.classList.toggle('in-view', entry.isIntersecting);
});
}, { threshold: 0.25 }).observe(section);