Greensock Bezier Morph

2,463 Kb

How do I make an greensock bezier morph?

A little experiment to animate the elements from one bezier curve to another using Greensock Animation Platform.. What is a greensock bezier morph? How do you make a greensock bezier morph? This script and codes were developed by Rodrigo Hernando on 16 November 2022, Wednesday.

Greensock Bezier Morph Previews

Greensock Bezier Morph - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Greensock Bezier Morph</title> <script src="" type="text/javascript"></script> <link rel="stylesheet" href="css/style.css">
<body> <h2> Greensock Bezier Morph
<div class="marker" id="rotate"></div>
<div class="marker" id="rotate2"></div> <script src=''></script>
<script src=''></script> <script src="js/index.js"></script>

Greensock Bezier Morph - Script Codes CSS Codes

{	background:#222;	margin:0;
{ font:34px "Trebuchet MS", Arial, Helvetica, sans-serif; color:#FFF; text-align:center;
.div1, .div2, .marker
{	width:10px;	height:10px;	background:#00f;	position:absolute;	margin-top:100px;	margin-left:70px;
{	background:none;

Greensock Bezier Morph - Script Codes JS Codes

var path1 = [{x:0, y:0},{x:100, y:100},{x:200,y:0},{x:300,y:100},{x:400,y:0}],	path2 = [{x:0,y:0},{x:100,y:-50},{x:200,y:400},{x:300,y:300},{x:400,y:400}],	curve1 = [], point1, curve2 = [], point2, dot1, rotate = $("div#rotate"),rotate2 = $("div#rotate2"), amount = 50, tween1 =, amount,	{	bezier:	{	values:path1, autoRotate:true	},	paused:true, ease:Linear.easeNone	}),	tween2 =, amount,	{	bezier:	{	values:path2, autoRotate:true	},	paused:true, ease:Linear.easeNone	}),	count = 0;
TweenMax.set(rotate, {x:0,y:0,rotation:0});
TweenMax.set(rotate2, {x:0,y:0,rotation:0});
for(var i = 0; i <= amount; i++)
{	dot1 = $('<div />' ,{id:'dot1-' + i}).addClass('div1').appendTo('body');	tween1.time(i);	tween2.time(i);	point1 = {x:rotate[0]._gsTransform.x, y:rotate[0]._gsTransform.y, rotation:(rotate[0]._gsTransform.rotation)};	point2 = {x:rotate2[0]._gsTransform.x, y:rotate2[0]._gsTransform.y, rotation:(rotate2[0]._gsTransform.rotation)};	curve1.push(point1);	curve2.push(point2);	TweenMax.set($("div#dot1-"+i), {x:point1.x, y:point1.y, rotation:point1.rotation+'_short', delay:.05*i});
{	morphBezier();
},(amount*.05*1000) + 500);
function morphBezier()
{	$.each($("div.div1"),function(index,element)	{, 1, {x:curve2[index].x, y:curve2[index].y, rotation:curve2[index].rotation+'_short', repeat:-1, yoyo:true, repeatDelay:1});	});
Greensock Bezier Morph - Script Codes
Greensock Bezier Morph - Script Codes
Home Page Home
Developer Rodrigo Hernando
Username rhernando
Uploaded November 16, 2022
Rating 3.5
Size 2,463 Kb
Views 66,792
Do you need developer help for Greensock Bezier Morph?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Rodrigo Hernando (rhernando) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!