Rotating tunnel of rainbowness
How do I make an rotating tunnel of rainbowness?
Overlay idea from @chinchang. What is a rotating tunnel of rainbowness? How do you make a rotating tunnel of rainbowness? This script and codes were developed by Matei Copot on 12 June 2022, Sunday.
Rotating tunnel of rainbowness - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>rotating tunnel of rainbowness</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, html { background-color:#111; overflow:hidden; margin:0 0;
}
#c { position:absolute; top: calc(50vh - 200px); left: calc(50vw - 200px);
}
#alpha { position:absolute; top: calc(50vh + 220px); left: calc(50vw - 50px); width:100px; height:40px; background-color: #000; border:none; font:20px Verdana; color:white; text-shadow:0 0 2px white; cursor:pointer; transition:.4s;
}
#alpha:focus { outline:none;
}
#alpha:hover { background-color: #555;
}
#overlay { position: absolute; width: 400px; height: 400px; top: calc(50vh - 200px); left: calc(50vw - 200px); background-image: radial-gradient(transparent 20%, #111 69%);
} </style> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <canvas id=c></canvas>
<button id=alpha>alpha</button>
<div id=overlay></div> <script src="js/index.js"></script>
</body>
</html>
Rotating tunnel of rainbowness - Script Codes CSS Codes
body, html { background-color:#111; overflow:hidden; margin:0 0;
}
#c { position:absolute; top: calc(50vh - 200px); left: calc(50vw - 200px);
}
#alpha { position:absolute; top: calc(50vh + 220px); left: calc(50vw - 50px); width:100px; height:40px; background-color: #000; border:none; font:20px Verdana; color:white; text-shadow:0 0 2px white; cursor:pointer; transition:.4s;
}
#alpha:focus { outline:none;
}
#alpha:hover { background-color: #555;
}
#overlay { position: absolute; width: 400px; height: 400px; top: calc(50vh - 200px); left: calc(50vw - 200px); background-image: radial-gradient(transparent 20%, #111 69%);
}
Rotating tunnel of rainbowness - Script Codes JS Codes
var w = c.width = h = c.height = 400, ctx = c.getContext('2d'), total = 50, particlesParRow = 10, minValue = 30, updatesBeforeStart = 500, repaintColor = 'rgba(0, 0, 0, .04)', templateColor = 'hsl(hue, 80%, 50%)', particles = [], colors = [], radiants = [], colorPart = 360/total, radiantPart = Math.PI*2/total, alphaValue = true;
for(var i = 0; i < total; ++i){ var array = []; particles.push(array); colors.push(templateColor.replace('hue', colorPart * i)); radiants.push(radiantPart * i); for(var j = 0; j < particlesParRow; ++j){ array.push(i * minValue); }
}
for(var i = 0; i < updatesBeforeStart; ++i) update();
function anim(){ window.requestAnimationFrame(anim); ctx.fillStyle = repaintColor; ctx.beginPath(); ctx.arc(w/2, h/2, w/2 + 1, 0, Math.PI * 2); ctx.fill(); ctx.closePath(); ctx.translate(w/2, h/2); ctx.rotate(.006); ctx.translate(-w/2, -h/2); for(var i = 0; i < total; ++i){ ctx.fillStyle = colors[i]; for(var j = 0; j < particlesParRow; ++j){ var particle = particles[i][j]; particles[i][j] -= particle/70; ctx.beginPath(); ctx.arc(w/2, h/2, particle, radiants[i], radiants[i] + radiantPart); ctx.arc(w/2, h/2, particles[i][j], radiants[i] + radiantPart, radiants[i], true); ctx.closePath(); ctx.fill(); if(particles[i][j] <= minValue && Math.random() < .1){ particles[i][j] = w/2; } } }
}
anim();
function update(){ for(var i = 0; i < total; ++i){ for(var j = 0; j < particlesParRow; ++j){ var particle = particles[i][j]; particles[i][j] -= particle/70; if(particles[i][j] <= minValue && Math.random() < .1){ particles[i][j] = w/2; } } }
}
alpha.addEventListener('click', function(){ if(alphaValue){ alphaValue = false; repaintColor = 'black'; alpha.textContent = 'solid'; } else { alphaValue = true; repaintColor = 'rgba(0, 0, 0, .04)'; alpha.textContent = 'alpha'; }
})
Developer | Matei Copot |
Username | towc |
Uploaded | June 12, 2022 |
Rating | 4.5 |
Size | 2,885 Kb |
Views | 28,336 |
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 |
Hexagonical retro tiles | 2,901 Kb |
Binary spiral | 2,370 Kb |
Turret of Order | 4,000 Kb |
Plasma background | 3,338 Kb |
Webgl fireworks | 3,820 Kb |
Superimpositional garden | 3,307 Kb |
Progression of ideas through willpower and motivation | 2,968 Kb |
Organic lines of staring-atness | 2,415 Kb |
Eiffel Tower | 3,692 Kb |
JS canvas 3d tree generator | 3,290 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 |
Flat UI Button | Honchoman | 2,289 Kb |
Tab panels | Accessibility | 0 Kb |
Velocity.js custom stagger | Tommiehansen | 4,805 Kb |
FCC_Twitch.tv | MitchES | 3,466 Kb |
Table Exercise | Fresco | 9,585 Kb |
Front in Aracaju Logo Pure CSS | Shankarcabus | 2,581 Kb |
Sony Xperia Z3 Flat MockUp | Dapinitial | 4,379 Kb |
HexMaze | Cantelope | 4,825 Kb |
Button fills | Zubfatal | 5,205 Kb |
Practice using Wixel | Emnk | 3,057 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!