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 |
Curl Request to Node Request | 3,000 Kb |
CSS Voxel Animation | 3,005 Kb |
FizzBuzz CAPTCHA | 2,568 Kb |
FontAwesome | 4,360 Kb |
8bit Animation | 2,764 Kb |
Text Vortex | 6,534 Kb |
Faces | 3,526 Kb |
Ripple Words | 3,081 Kb |
Raw Request to Requester Request | 3,112 Kb |
Dippin Dots | 2,459 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 |
Tic Tac Toe | Volv | 4,862 Kb |
Wikipedia viewer | Chpecson | 2,865 Kb |
Pictos font library from CodePen | Jstam | 3,790 Kb |
Day 11 - Calendar Card | Arnellebalane | 6,984 Kb |
Click handler test | Snapson | 2,329 Kb |
Google Maps API Ground Overlay | Boycetrus | 2,961 Kb |
CSS-Flexbox-Demo | Sstiglets | 1,709 Kb |
Formations | Cantelope | 5,731 Kb |
Angular Route | Arun_v606 | 1,837 Kb |
Buttons for autumn | Nikazawila | 1,795 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!