TweenMax animating array object

Developer
Size
2,168 Kb
Views
36,432

How do I make an tweenmax animating array object?

Instead of supplying a tween object per usual... supply an array with other tween specific properties glommed onto it.. What is a tweenmax animating array object? How do you make a tweenmax animating array object? This script and codes were developed by Elliot Geno on 11 September 2022, Sunday.

TweenMax animating array object Previews

TweenMax animating array object - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>TweenMax animating array object</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 300 300" enable-background="new 0 0 300 300" xml:space="preserve">	<polygon id="star" fill="#FFFFFF" points="150,30,177,113,264,113,193,164,220,247,150,196,80,247,107,164,36,113,123,113" />
</svg> <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.17.0/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

TweenMax animating array object - Script Codes CSS Codes

body {	background: darkblue;	overflow: hidden;
}
svg {	width: 100%;	height: 100%;	position: absolute;
}

TweenMax animating array object - Script Codes JS Codes

var points = [150, 30, 177, 113, 264, 113, 193, 164, 220, 247, 150, 196, 80, 247, 107, 164, 36, 113, 123, 113];
// different array same number of items - this one is just has the last two items moved to the front.
var targetPoints = [123, 113, 150, 30, 177, 113, 264, 113, 193, 164, 220, 247, 150, 196, 80, 247, 107, 164, 36, 113];
// use target array as the tween object to store tween properties... HACKY I KNOW!
targetPoints.repeat = -1;
targetPoints.repeatDelay = 1;
targetPoints.ease = Back.easeInOut;
TweenMax.to(points, 1.2, targetPoints);
targetPoints.onUpdate = function() {	star.setAttribute("points", points);
}
TweenMax animating array object - Script Codes
TweenMax animating array object - Script Codes
Home Page Home
Developer Elliot Geno
Username pyrografix
Uploaded September 11, 2022
Rating 3
Size 2,168 Kb
Views 36,432
Do you need developer help for TweenMax animating array object?

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!

Elliot Geno (pyrografix) Script Codes
Create amazing sales emails 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!