Spiky Bubbles
How do I make an spiky bubbles?
You can change the numbers to produce different results. Change the circle delta to alter the jaggedness.. What is a spiky bubbles? How do you make a spiky bubbles? This script and codes were developed by David Hartley on 18 November 2022, Friday.
Spiky Bubbles - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Spiky Bubbles</title> <script src="https://s.codepen.io/assets/libs/modernizr.js" type="text/javascript"></script> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <style> /* NOTE: The styles were added inline because Prefixfree needs access to your styles and they must be inlined if they are on local disk! */ html, body { width: 100%; height: 100%; overflow: hidden;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <canvas id="canvas"></canvas> <script src="js/index.js"></script>
</body>
</html>
Spiky Bubbles - Script Codes CSS Codes
html, body { width: 100%; height: 100%; overflow: hidden;
}
Spiky Bubbles - Script Codes JS Codes
(function() { function Circle(config) { this.x = config.x || 0; this.y = config.y || 0; this.radius = config.radius || 50; this.numPoints = this.radius * 4; this.delta = this.radius / 1.5; this.points = this.getPoints(); this.colour = this.getColour(); } Circle.prototype = { getPoints: function() { var points = []; var x, y; for (var i=0; i<this.numPoints; i++) { x = (Math.random() * this.delta) - (this.delta / 2); y = (Math.random() * this.delta) - (this.delta / 2); points[i] = {x: x, y: y}; } return points; }, getColour: function() { var r = Math.floor(Math.random() * 255); var g = Math.floor(Math.random() * 255); var b = Math.floor(Math.random() * 255); var a = (Math.random() * 0.3) + 0.1; return "rgba(" + r + "," + g + "," + b + "," + a + ")"; }, draw: function(ctx) { ctx.save(); ctx.lineWidth = Math.round(this.radius / 50); ctx.strokeStyle = this.colour; ctx.fillStyle = this.colour; ctx.beginPath(); var progress, x, y; x = this.x + (this.radius + this.points[0].x) * Math.cos(0); y = this.y + (this.radius + this.points[0].y) * Math.sin(0); ctx.moveTo(x, y); for (var i=1; i<this.numPoints; i++) { progress = 2 * Math.PI / this.numPoints * i; x = this.x + (this.radius + this.points[i].x) * Math.cos(progress); y = this.y + (this.radius + this.points[i].y) * Math.sin(progress); ctx.lineTo(x, y); } ctx.fill(); //ctx.stroke(); ctx.closePath(); ctx.restore(); } }; window.Circle = Circle;
})();
var can = document.getElementById("canvas");
can.width = window.innerWidth;
can.height = window.innerHeight;
var ctx = can.getContext("2d");
var NUMBER = 2000;
for (var i=0; i<NUMBER; i++) { var circle = new Circle({ x: Math.random() * can.width, y: Math.random() * can.height, radius: Math.round(Math.random() * (Math.min(can.width, can.height) / 10)) }); circle.draw(ctx);
}
Developer | David Hartley |
Username | davidhartley |
Uploaded | November 18, 2022 |
Rating | 3 |
Size | 2,485 Kb |
Views | 20,240 |
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 David Hartley | 1,830 Kb |
PIXI.blendModes.ADD bug | 2,684 Kb |
Stars following mouse | 2,937 Kb |
Pixi.js Clouds Shader | 3,491 Kb |
The Avengers Logo | 4,576 Kb |
Click for star burst | 2,868 Kb |
PIXI v4 ShaderToy Compilation | 53,283 Kb |
Minecraft block | 3,595 Kb |
Footballs | 3,034 Kb |
Progress bars | 3,727 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 |
Sample Profile Screen | OurDailyBread | 5,375 Kb |
Rotate Demo | Agelber | 3,061 Kb |
Infractions - Attitude | Kylie_Joseph | 7,672 Kb |
Scroll Arrow | Robooneus | 4,437 Kb |
Wave Lines | Mikehobizal | 4,023 Kb |
CSS3 Form Page Design | Rssatnam | 3,613 Kb |
Slider css only | Armandobau | 2,161 Kb |
JQuery exercise | Brian-baum | 3,780 Kb |
Snow collision | Wojtek1150 | 3,542 Kb |
PNotify Demo | Adittmar | 1,731 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!