TweenMax animating array object
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 - 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);
}
Developer | Elliot Geno |
Username | pyrografix |
Uploaded | September 11, 2022 |
Rating | 3 |
Size | 2,168 Kb |
Views | 36,432 |
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!
Name | Size |
A Pen by Elliot Geno | 2,114 Kb |
Following a Path | 2,019 Kb |
Cat Silhouette | 4,447 Kb |
Stained Glass | 2,127 Kb |
Crash Loader | 2,615 Kb |
Alternate Tween Properties - TweenMax | 2,215 Kb |
Solar Explorer | 3,333 Kb |
Swarm | 2,384 Kb |
Calendar | 2,416 Kb |
Clock | 1,978 Kb |
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!
Name | Username | Size |
Zeichensatz | Moklick | 2,058 Kb |
RAQuote | Naderk007 | 4,412 Kb |
Tree growth tests | Orchard | 3,818 Kb |
Tab Menus | Zephyr | 3,180 Kb |
Sticky footer testing | 75th | 1,649 Kb |
Click Based Rotation Demo | Zeaklous | 2,086 Kb |
Loading Bar | Jaradlight | 2,333 Kb |
Word Wrap Algorithm for Multiline Canvas Text | Peterhry | 2,349 Kb |
Social.svg.min | Larsenwork | 13,849 Kb |
Wikipedia Viewer | Thalpha | 4,426 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!