Rainbow transfer
How do I make an rainbow transfer?
What is a rainbow transfer? How do you make a rainbow transfer? This script and codes were developed by Matei Copot on 16 October 2022, Sunday.
Rainbow transfer - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>rainbow transfer</title> <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 { margin: 0 0 0 0; background-color: #222;
}
canvas { position: absolute; top: calc( 50% - 250px ); left: calc( 50% - 250px ); background-color: #333; border-radius: 20%; box-shadow: 0 0 10px black;
} </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="js/index.js"></script>
</body>
</html>
Rainbow transfer - Script Codes CSS Codes
body { margin: 0 0 0 0; background-color: #222;
}
canvas { position: absolute; top: calc( 50% - 250px ); left: calc( 50% - 250px ); background-color: #333; border-radius: 20%; box-shadow: 0 0 10px black;
}
Rainbow transfer - Script Codes JS Codes
var s = c.width = c.height = 500, ctx = c.getContext( '2d' ), particles = [], clouds = [], cx = s / 2, cy = s / 3 * 2, cloudCx1 = cx - s / 3, cloudCx2 = cx + s / 3;
ctx.lineWidth = 2;
function Particle(){ this.reset();
}
Particle.prototype.reset = function(){ this.rad = -Math.PI; this.speed = .01 + Math.random() * .02; var depth = Math.random() * 80; this.color = 'hsl(hue,80%,50%)'.replace( 'hue', depth / 8 * 36 ); this.len = s / 3 + depth - 40;
}
Particle.prototype.step = function(){ ctx.strokeStyle = this.color; ctx.beginPath(); ctx.arc( cx, cy, this.len, this.rad, this.rad += this.speed ); ctx.stroke(); if( this.rad > 0 ) this.reset();
}
function Cloud(){ this.reset();
}
Cloud.prototype.reset = function(){ this.x = Math.random() < .5 ? cloudCx1 : cloudCx2; this.x += Math.random() * 50 * ( Math.random() < .5 ? 1 : -1 ); this.y = cy + Math.random() * 10 * ( Math.random() < .5 ? 1 : -1 ); this.maxRadius = 30 + 10 * Math.random(); this.tick = 0; this.maxTick = ( 40 + 10 * Math.random() ) |0;
}
Cloud.prototype.step = function(){ ++this.tick; var radius = this.maxRadius * ( Math.cos( this.tick / this.maxTick * Math.PI * 2 - Math.PI ) / 2 + .5 ), gradient = ctx.createRadialGradient( this.x, this.y, 0, this.x, this.y, radius ); gradient.addColorStop( 0, 'rgba(255,255,255,1)' ); gradient.addColorStop( 1, 'rgba(255,255,255,0)' ); ctx.fillStyle = gradient; ctx.beginPath(); ctx.arc( this.x, this.y, radius, 0, Math.PI * 2 ); ctx.fill(); if( this.tick > this.maxRadius ) this.reset();
}
function anim(){ window.requestAnimationFrame( anim ); ctx.fillStyle = 'rgba(0,0,0,.04)'; ctx.fillRect( 0, 0, s, s ); if( particles.length < 200 && Math.random() < .5 ) particles.push( new Particle ); if( clouds.length < 30 && Math.random() < .1 ) clouds.push( new Cloud ); particles.map( function( particle ){ particle.step(); } ); clouds.map( function( cloud ){ cloud.step(); } );
}
ctx.fillStyle = '#333';
ctx.fillRect( 0, 0, s, s );
anim();
Developer | Matei Copot |
Username | towc |
Uploaded | October 16, 2022 |
Rating | 4 |
Size | 2,566 Kb |
Views | 14,168 |
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 |
Rainbow galaxy | 3,633 Kb |
Webgl fireworks | 3,820 Kb |
Binary spiral | 2,370 Kb |
Neural Network visualization | 4,562 Kb |
Invasion of creepy crawly rainbow fireflies | 3,094 Kb |
Mathematically armonic circular lines | 2,476 Kb |
Turret of Order | 4,000 Kb |
Hexagonical retro tiles | 2,901 Kb |
Random curve-pathed particles of rainbowness | 2,576 Kb |
Neon hexagon-forming particles | 2,821 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 |
Pure CSS Dial | Lukewatts | 3,018 Kb |
Header Line Issue | Charlie-volpe | 1,768 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
IPhone5S SVG Space Grey | Onlinechris | 75,035 Kb |
CSS3 Form | Tusharbandal | 1,836 Kb |
Email Marketing Mock | Kristenzirkler | 8,224 Kb |
Responsive Pricing Table | Jeremycaris | 2,690 Kb |
Konami Code Easter Egg | Teolitto | 3,051 Kb |
CSS Dynamic Width Square Div | Elleestcrimi | 2,861 Kb |
HTM5 picture dropzone | Jaysalvat | 2,576 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!