Canvas Color Smoke
How do I make an canvas color smoke?
What is a canvas color smoke? How do you make a canvas color smoke? This script and codes were developed by Jack Rugile on 11 August 2022, Thursday.
Canvas Color Smoke - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Canvas Color Smoke</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! */ html, body { height: 100%;
}
canvas { background: #000; display: block; height: 100%; width: 100%;
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <canvas id="c"></canvas> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Canvas Color Smoke - Script Codes CSS Codes
html, body { height: 100%;
}
canvas { background: #000; display: block; height: 100%; width: 100%;
}
Canvas Color Smoke - Script Codes JS Codes
(function() { var Blip, blips, c, ch, clear, ctx, cw, divider, globalTick, initialBlips, pi2, rand, run; c = document.getElementById('c'); ctx = c.getContext('2d'); divider = 4; cw = c.width = window.innerWidth / divider; ch = c.height = window.innerHeight / divider; pi2 = Math.PI * 2; blips = []; initialBlips = 30; globalTick = 0; rand = function(min, max) { return Math.floor((Math.random() * (max - min + 1)) + min); }; Blip = function(x, y) { this.x = x; this.y = y; this.r = .1; this.rGrowthBase = 1; this.rGrowth = this.rGrowthBase; this.rMax = (cw + ch) / 7; return this.alpha = 1; }; Blip.prototype.update = function(i) { var percent; percent = (this.rMax - this.r) / this.rMax; this.rGrowth = .1 + this.rGrowthBase * percent; this.r += this.rGrowth; this.alpha = percent; if (this.r > this.rMax) { return blips.splice(i, 1); } }; Blip.prototype.render = function(i) { ctx.beginPath(); ctx.arc(this.x, this.y, this.r, 0, pi2, false); ctx.fillStyle = 'hsla(' + rand(globalTick - 80, globalTick + 80) + ', 50%, 1%, ' + this.alpha + ')'; return ctx.fill(); }; clear = function() { ctx.globalCompositeOperation = 'destination-out'; ctx.fillStyle = 'hsla(0, 0%, 0%, .05)'; ctx.fillRect(0, 0, cw, ch); return ctx.globalCompositeOperation = 'lighter'; }; run = function() { var i; window.requestAnimationFrame(run, c); clear(); i = blips.length; while (i--) { blips[i].update(i); } i = blips.length; while (i--) { blips[i].render(i); } blips.push(new Blip(rand(0, cw), rand(0, ch))); return globalTick++; }; $(window).on('resize', function() { cw = c.width = window.innerWidth / divider; return ch = c.height = window.innerHeight / divider; }); window.requestAnimationFrame || (window.requestAnimationFrame = window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(callback, element) { return window.setTimeout(function() { return callback(+new Date()); }, 1000 / 60); }); run();
}).call(this);
Developer | Jack Rugile |
Username | jackrugile |
Uploaded | August 11, 2022 |
Rating | 4.5 |
Size | 3,446 Kb |
Views | 42,504 |
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 |
Abstract Canvas Visualization | 3,459 Kb |
Canvas Parallax Skyline | 4,871 Kb |
Canvas Orbital Trails | 3,697 Kb |
Canvas Parallax Mountains | 4,573 Kb |
Canvas Swarming Bugs | 4,599 Kb |
Canvas Radar | 3,074 Kb |
Bubble Sketch.js Test | 3,437 Kb |
Canvas Fireworks | 6,200 Kb |
In View Detector | 9,081 Kb |
Scroll Progress as Canvas to Favicon | 2,407 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 |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
My three.js practice | Esambino | 3,203 Kb |
LAMP PURE CSS with Animation | Dam62500 | 2,911 Kb |
Using Flickr API | MoyArt | 6,761 Kb |
Two Element Typeface | Chrisota | 4,942 Kb |
Obligatory CSS3 UI Nav | Romandiaz | 9,017 Kb |
Disable JavaScript execution from console | Ludviglindblom | 2,534 Kb |
Toggling Divs with jQuery | Yying6 | 1,967 Kb |
Canvas Fireworks | Jackrugile | 6,200 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!