Dippin Dots
How do I make an dippin dots?
Playing with decays. What is a dippin dots? How do you make a dippin dots? This script and codes were developed by Chad Scira on 27 August 2022, Saturday.
Dippin Dots - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Dippin Dots</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <script src='https://rawgit.com/icodeforlove/4cbc3b3badd3b3d4720c/raw/027ee25afb208de28018604298c1a70ecd41ff07/decay-particle.js'></script> <script src="js/index.js"></script>
</body>
</html>
Dippin Dots - Script Codes CSS Codes
body { margin: 0; padding: 0; background: #17293a;
}
Dippin Dots - Script Codes JS Codes
var canvas = document.createElement('canvas'), context = canvas.getContext('2d');
canvas.width = window.innerWidth;
canvas.height = window.innerHeight;
document.body.appendChild(canvas);
Particle.prototype.getPoint = function () { return { x: (this.current.radius * Math.cos(this.current.angle * Math.PI / 180)) + this.current.x - (this.current.w/2), y: (this.current.radius * Math.sin(this.current.angle * Math.PI / 180)) + this.current.y - (this.current.h/2) };
}
var particles = [];
for (var i = 0; i < 1000; i++) { particles.push(new Particle({ x: window.innerWidth/2, y: window.innerHeight/2, w: Particle.prototype.random(1,3), h: Particle.prototype.random(1,3), radius: Particle.prototype.random(Math.random() < .4 ? 1 : 20,75), angle: Particle.prototype.random(0, 360), color: 'rgb(' + [Math.floor(Math.random() * 255),Math.floor(Math.random() * 255),Math.floor(Math.random() * 255)].join(',') + ')', minAngleDecay: Particle.prototype.random(10, 600) }));
}
var lastFrame = 0, fps = 60, start = Date.now();
function draw() { requestAnimationFrame(draw); var frame = Math.floor((Date.now() - start) / (1000/fps)); if (lastFrame === frame) { return; } context.clearRect(0, 0, canvas.width, canvas.height); particles.forEach(function (particle) { if (Math.random() > .90 && (!particle.decay.angle || Math.floor(Math.abs(particle.decay.angle)) < particle.value.minAngleDecay)) { particle.decay.angle = particle.random(particle.value.minAngleDecay, 200); } if (Math.random() > .90 && (!particle.decay.radius || Math.floor(Math.abs(particle.decay.radius)) < 20)) { particle.decay.radius = particle.value.radius - particle.current.radius; } for (var i = 0; i < frame - lastFrame; i++) { particle.updateDecay(.97); } var point = particle.getPoint(); context.fillStyle = particle.value.color; context.beginPath(); context.arc(point.x, point.y, particle.current.w/2, 0, 2 * Math.PI, false); context.fill(); }); lastFrame = frame;
}
draw();
var mouseDownTime;
window.addEventListener('mousedown', function () { mouseDownTime = new Date();
});
window.addEventListener('mouseup', function () { particles.forEach(function (particle) { particle.decay.radius = particle.random(0, new Date() - mouseDownTime); });
});
window.addEventListener('mousemove', function (event) { particles.forEach(function (particle) { particle.decay.x = event.x - particle.current.x; particle.decay.y = event.y - particle.current.y; })
});
Developer | Chad Scira |
Username | icodeforlove |
Uploaded | August 27, 2022 |
Rating | 3.5 |
Size | 2,459 Kb |
Views | 40,480 |
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 |
Delayed Follow | 2,306 Kb |
Curl Request to Node Request | 3,000 Kb |
Canvas Text Vortex | 3,252 Kb |
Animated rainbow wave on canvas | 2,777 Kb |
Animated 3D Text | 3,272 Kb |
Faces | 3,526 Kb |
FizzBuzz CAPTCHA | 2,568 Kb |
Client-side nudity detection | 6,271 Kb |
Text Vortex | 6,534 Kb |
A Pen by Chad Scira | 2,150 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 |
Cool Page Split Effect | Anthonyadamski | 6,128 Kb |
Particle Motion trajectories | Sniejadlik | 5,899 Kb |
Layout | X-gyba | 4,234 Kb |
Pricing Table | Semenchenko | 6,784 Kb |
Portfolio Page | HuffmanJ25 | 5,240 Kb |
CSS3 Fullscreen Background Slideshow | Leetech | 3,435 Kb |
Image Hover | Johnheiner | 3,409 Kb |
Button Option Group | Honchoman | 1,859 Kb |
Practice using Wixel | Emnk | 3,057 Kb |
Process Accordion | Devilskitchen | 31,432 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!