Canvas Simple Circle Loader

Developer
Size
2,946 Kb
Views
44,528

How do I make an canvas simple circle loader?

What is a canvas simple circle loader? How do you make a canvas simple circle loader? This script and codes were developed by Jack Rugile on 11 August 2022, Thursday.

Canvas Simple Circle Loader Previews

Canvas Simple Circle Loader - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Canvas Simple Circle Loader</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! */ body { background: #111 url(/images/classy_fabric.png);
}
canvas { background: radial-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .9)); display: block;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script src='https://rawgithub.com/soulwire/sketch.js/master/js/sketch.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Canvas Simple Circle Loader - Script Codes CSS Codes

body { background: #111 url(/images/classy_fabric.png);
}
canvas { background: radial-gradient(rgba(0, 0, 0, .25), rgba(0, 0, 0, .9)); display: block;
}

Canvas Simple Circle Loader - Script Codes JS Codes

(function() { var Particle; Particle = (function() { function Particle(x, y) { this.x = x; this.y = y; this.radius = 5; this.decayRate = .07; } Particle.prototype.update = function(ctx, index) { if (this.radius > this.decayRate) { return this.radius -= this.decayRate; } else { return ctx.particles.splice(index, 1); } }; Particle.prototype.draw = function(ctx, index) { ctx.beginPath(); ctx.arc(this.x, this.y, this.radius, 0, TWO_PI); ctx.fillStyle = 'hsla(' + ctx.hue + ', 100%, ' + (index / ctx.particles.length) * 90 + '%, ' + (index / ctx.particles.length) + ')'; return ctx.fill(); }; return Particle; })(); Sketch.create({ setup: function() { this.tick = 0; this.particles = []; this.hue = 120; return this.anchor = { x: this.width / 2, y: this.height / 2, radius: 40, angle: 0, speed: 0.07 }; }, update: function() { var i, results; this.anchor.angle += this.anchor.speed; this.particles.push(new Particle(this.anchor.x + cos(this.anchor.angle) * this.anchor.radius, this.anchor.y + sin(this.anchor.angle) * this.anchor.radius)); this.hue += 1; i = this.particles.length; results = []; while (i--) { results.push(this.particles[i].update(this, i)); } return results; }, draw: function() { var i, results; i = this.particles.length; results = []; while (i--) { results.push(this.particles[i].draw(this, i)); } return results; } });
}).call(this);
Canvas Simple Circle Loader - Script Codes
Canvas Simple Circle Loader - Script Codes
Home Page Home
Developer Jack Rugile
Username jackrugile
Uploaded August 11, 2022
Rating 4.5
Size 2,946 Kb
Views 44,528
Do you need developer help for Canvas Simple Circle Loader?

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!

Jack Rugile (jackrugile) Script Codes
Create amazing blog posts 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!