<main>
<div id="box-1">curviness: 0</div>
<div id="box-2">curviness: 2</div>
</main>
<a href="https://greensock.com" target="_blank"><img class="gsap-3-logo" src="https://s3-us-west-2.amazonaws.com/s.cdpn.io/16327/gsap-3-logo.svg" width="150" /></a>
main {
width: 100%; min-height: 100vh;
display: flex; flex-flow: row nowrap; justify-content: space-evenly; align-items: center;
}
div {
background: dodgerblue;
text-align: center;
font-family: Arial, sans-serif;
font-size: 34px;
line-height: 150px;
border-radius: 20px;
width: 240px; height: 150px;
}
body {
background-color: black;
}
.gsap-3-logo {
width: 20vw;
max-width: 150px;
position: fixed;
bottom: 15px;
right: 15px;
}
var scales = [{scale:1.6}, {scale:0.2}, {scale:1}];
gsap.to('#box-1', {
motionPath: {
path: scales,
curviness: 0
},
duration: 3,
ease: "none",
repeat: -1,
repeatDelay: 1
});
gsap.to('#box-2', {
motionPath: {
path: scales,
curviness: 2
},
duration: 3,
ease: "none",
repeat: -1,
repeatDelay: 1
});
This Pen doesn't use any external CSS resources.