I have to change scale of element (like box on codepen example) in the intersection of section to 0. In the center of section the element should scale to 1.
Example:
<p class="codepen" data-height="300" data-default-tab="html,result" data-slug-hash="ZEMwJyv" data-user="mishamgla" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;">
<span>See the Pen <a href="https://codepen.io/mishamgla/pen/ZEMwJyv">
Scrub Animations - ScrollTrigger</a> by MishaMgla (<a href="https://codepen.io/mishamgla">@mishamgla</a>)
on <a href="https://codepen.io">CodePen</a>.</span>
</p>
<script async src="https://cpwebassets.codepen.io/assets/embed/ei.js"></script>
I am aware of gsap.to() duplications. Is there a way to make it without duplication? As it is highly possible, there will be lot of sections.