Delayed Follow
How do I make an delayed follow?
TweenMax testing overlapping tweens, click to wreak havoc.. What is a delayed follow? How do you make a delayed follow? This script and codes were developed by Chad Scira on 27 August 2022, Saturday.
Delayed Follow - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Delayed Follow</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/gsap/1.11.5/TweenMax.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Delayed Follow - Script Codes CSS Codes
body { margin: 0; background-color: #17293a; overflow: hidden;
}
.particle { width: 5px; height: 5px; margin-left: -2.5px; margin-top: -2.5px; background: #fff; position: absolute; backface-visibility: hidden; -moz-backface-visibility: hidden; -webkit-backface-visibility: hidden;
}
Delayed Follow - Script Codes JS Codes
function Scene () { this.render = this.render.bind(this); this.onClick = this.onClick.bind(this); this.onMouseMove = this.onMouseMove.bind(this); this.elements = []; this.clickAnimating = false; this.timeline = new TimelineMax({onUpdate: this.render}); this.totalElements = 300; window.addEventListener('click', this.onClick); window.addEventListener('mousemove', this.onMouseMove); this.createElements(); this.render();
}
Scene.prototype = { createElements: function () { for (var i = 0; i < this.totalElements; i++) { var element = document.createElement('div'); element.className = 'particle'; element.backing = {x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight}; document.body.appendChild(element); this.elements.push(element); } }, onMouseMove: function (event) { if (this.clickAnimating) { return; } this.elements.forEach(function (element) { this.timeline.to(element.backing, .25 + Math.random()*3, {x: event.pageX + ((Math.random() * 20) - 10), y: event.pageY + ((Math.random() * 20) - 10), ease: Cubic.easeOut}, this.timeline.time()); }, this); }, onClick: function (event) { if (this.clickAnimating) { return; } this.clickAnimating = true; setTimeout(function () { this.clickAnimating = false; }.bind(this), 1250); this.elements.forEach(function (element) { this.timeline.to(element.backing, .25 + Math.random(), {x: Math.random() * window.innerWidth, y: Math.random() * window.innerHeight, ease: Bounce.easeOut}, this.timeline.time()); }, this); }, render: function () { this.elements.forEach(function (element) { element.style.transform = element.style.mozTransform = element.style.webkitTransform = 'translate3d(' + element.backing.x.toFixed(3) + 'px,' + element.backing.y.toFixed(3) + 'px,0)'; }, this); }
};
new Scene();
Developer | Chad Scira |
Username | icodeforlove |
Uploaded | August 27, 2022 |
Rating | 3 |
Size | 2,306 Kb |
Views | 32,384 |
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 |
CSS Voxel Animation | 3,005 Kb |
Text Vortex | 6,534 Kb |
FizzBuzz CAPTCHA | 2,568 Kb |
Raw Request to Requester Request | 3,112 Kb |
Live example of core distribution | 4,553 Kb |
Animated rainbow wave on canvas | 2,777 Kb |
Dippin Dots | 2,459 Kb |
Faces | 3,526 Kb |
Canvas Text Vortex | 3,252 Kb |
8bit Animation | 2,764 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 |
JQuery Validate checkbox group | Lunaman | 2,466 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
A Pen by John Malc | F789gh | 1,420 Kb |
SVG Text Masking | JMChristensen | 2,141 Kb |
TweenMax transformOrigin Bubble | Nicolund | 2,209 Kb |
Donald Trump - The New Yorker | Agbales | 2,502 Kb |
After America | Jonathangarner | 2,686 Kb |
Haml Calendar | Katydecorah | 5,643 Kb |
Popover Example | Seanboom | 2,429 Kb |
Client-side Email Validation | Collizo4sky | 1,538 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!