Bubble Sketch.js Test
How do I make an bubble sketch.js test?
Giving Sketch.js, by Soulwire, a quick test and loving it. Learn more about it here: http://soulwire.github.com/sketch.js/. What is a bubble sketch.js test? How do you make a bubble sketch.js test? This script and codes were developed by Jack Rugile on 11 August 2022, Thursday.
Bubble Sketch.js Test - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Bubble Sketch.js Test</title> <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! */ canvas { background: #023; display: block;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='https://rawgithub.com/soulwire/sketch.js/master/js/sketch.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Bubble Sketch.js Test - Script Codes CSS Codes
canvas { background: #023; display: block;
}
Bubble Sketch.js Test - Script Codes JS Codes
(function() { var Particle, particleCount, particles, sketch, z; sketch = Sketch.create(); particles = []; particleCount = 750; sketch.mouse.x = sketch.width / 2; sketch.mouse.y = sketch.height / 2; sketch.strokeStyle = 'hsla(200, 50%, 50%, .4)'; sketch.globalCompositeOperation = 'lighter'; Particle = function() { this.x = random(sketch.width); this.y = random(sketch.height, sketch.height * 2); this.vx = 0; this.vy = -random(1, 10) / 5; this.radius = this.baseRadius = 1; this.maxRadius = 50; this.threshold = 150; return this.hue = random(180, 240); }; Particle.prototype = { update: function() { var dist, distx, disty, radius; distx = this.x - sketch.mouse.x; disty = this.y - sketch.mouse.y; dist = sqrt(distx * distx + disty * disty); if (dist < this.threshold) { radius = this.baseRadius + ((this.threshold - dist) / this.threshold) * this.maxRadius; this.radius = radius > this.maxRadius ? this.maxRadius : radius; } else { this.radius = this.baseRadius; } this.vx += (random(100) - 50) / 1000; this.vy -= random(1, 20) / 10000; this.x += this.vx; this.y += this.vy; if (this.x < -this.maxRadius || this.x > sketch.width + this.maxRadius || this.y < -this.maxRadius) { this.x = random(sketch.width); this.y = random(sketch.height + this.maxRadius, sketch.height * 2); this.vx = 0; return this.vy = -random(1, 10) / 5; } }, render: function() { sketch.beginPath(); sketch.arc(this.x, this.y, this.radius, 0, TWO_PI); sketch.closePath(); sketch.fillStyle = 'hsla(' + this.hue + ', 60%, 40%, .35)'; sketch.fill(); return sketch.stroke(); } }; z = particleCount; while (z--) { particles.push(new Particle()); } sketch.clear = function() { return sketch.clearRect(0, 0, sketch.width, sketch.height); }; sketch.update = function() { var i, results; i = particles.length; results = []; while (i--) { results.push(particles[i].update()); } return results; }; sketch.draw = function() { var i, results; i = particles.length; results = []; while (i--) { results.push(particles[i].render()); } return results; };
}).call(this);
Developer | Jack Rugile |
Username | jackrugile |
Uploaded | August 11, 2022 |
Rating | 4.5 |
Size | 3,437 Kb |
Views | 50,600 |
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 |
Snake Game - CSS Renderer | 7,412 Kb |
Canvas Sparkly Circle Loader | 2,446 Kb |
CSS Vinyl Record | 3,972 Kb |
Canvas Swarming Bugs | 4,599 Kb |
Canvas Wave | 2,902 Kb |
Glitchy Loading Indicator | 2,745 Kb |
Canvas Orbital Trails v2 | 3,421 Kb |
Canvas Waterfall | 3,324 Kb |
In View Detector | 9,081 Kb |
Canvas Bokeh Generation | 2,935 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 |
See Through | Larrygeams | 77,410 Kb |
CSS3 Button Examples | Volusion | 3,377 Kb |
A Pen by Jim Savage | Madebyjam | 2,418 Kb |
CSS Colors | Alexpate | 2,232 Kb |
A Pen by Bryan | Brydave | 2,286 Kb |
SVG Animation | Pollardld | 3,133 Kb |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
My Interests | Anshusaxenaarora | 2,015 Kb |
CSS Gem Badge | Orchard | 3,335 Kb |
The Fly | GianlucaGuarini | 3,405 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!