Tween Bubbles.

Developer
Size
2,175 Kb
Views
6,072

How do I make an tween bubbles.?

Cool.. What is a tween bubbles.? How do you make a tween bubbles.? This script and codes were developed by Dave DeHaan on 04 January 2023, Wednesday.

Tween Bubbles. Previews

Tween Bubbles. - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Tween Bubbles.</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="stage" width="500" height="100"></canvas> <script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/TweenLite.min.js'></script>
<script src='https://s3-us-west-2.amazonaws.com/s.cdpn.io/53148/easeljs-0.7.1.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Tween Bubbles. - Script Codes CSS Codes

* { position: absolute; margin: 0; padding: 0;
}

Tween Bubbles. - Script Codes JS Codes

(function(){ var stage, circles; var colors = ['#EEE', '#DDD', '#CCC', '#BBB', '#AAA']; function init() { initStages(); initCircles(); animate(); } // Init Canvas function initStages() { stage = new createjs.Stage("stage"); stage.canvas.width = window.innerWidth; stage.canvas.height = window.innerHeight; } function initCircles() { circles = []; for(var i=0; i<600; i++) { var circle = new createjs.Shape(); var color = colors[Math.floor(i%colors.length)]; circle.alpha = 0.25 + Math.random()*0.5; circle.radius = 5 + Math.floor(Math.random()*10); circle.graphics.beginStroke(color).drawCircle(0, 0, circle.radius); circle.x = window.innerWidth*Math.random(); circle.y = window.innerHeight*Math.random(); circles.push(circle); stage.addChild(circle); circle.movement = 'float'; tweenCircle(circle); } } // animating circles function animate() { stage.update(); requestAnimationFrame(animate); } function tweenCircle(c) { var scale = Math.random() + .5; c.tween = TweenLite.to( c, 5 + Math.random()*3.5, { x: c.x + -100+Math.random()*200, y: c.y + -100+Math.random()*200, ease:Quad.easeInOut, scaleX: scale, scaleY: scale, onComplete: function() { tweenCircle(c); } } ); } window.onload = function() { init() };
})();
Tween Bubbles. - Script Codes
Tween Bubbles. - Script Codes
Home Page Home
Developer Dave DeHaan
Username davedehaan
Uploaded January 04, 2023
Rating 4
Size 2,175 Kb
Views 6,072
Do you need developer help for Tween Bubbles.?

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!

Dave DeHaan (davedehaan) Script Codes
Create amazing Facebook ads 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!