Stick waves 2
How do I make an stick waves 2?
What is a stick waves 2? How do you make a stick waves 2? This script and codes were developed by Findoff on 03 October 2022, Monday.
Stick waves 2 - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>stick waves 2</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/meyer-reset/2.0/reset.min.css"> <script src="https://cdnjs.cloudflare.com/ajax/libs/prefixfree/1.0.7/prefixfree.min.js"></script>
</head>
<body> <script src='https://cdnjs.cloudflare.com/ajax/libs/dat-gui/0.5.1/dat.gui.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/stats.js/r16/Stats.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/seedrandom/2.4.2/seedrandom.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Stick waves 2 - Script Codes JS Codes
/* my editor width */
console.clear();
document.addEventListener('DOMContentLoaded', ()=>{ let canvas, ctx, w, h, vmin, vr, opts={}, gui, stats; function init(){ let t = Date.now(); opt('halt!', ()=> loop=()=>{} ); opt('mx', 0.5, 0,1).random = true; opt('my', 0.5, 0,1).random = true; opt('cols', 50, 2, 100).step(1); opt('startAngle', 0,0,Math.PI*2); opt('angle', Math.PI/8, 0, Math.PI/2).step(Math.PI/128).random = true; opt('leftAnchor', true); opt('clear', 1, 0,1).step(0.05); opt('random', false); opt('speed', 0.02, 0, 0.1); console.log('init time', Date.now()-t); } let startX = 0; let startY = 0; function loop(){ startX = ( startX + 0.002 ) % 1; startY = ( startY + 0.004 ) % 1; stats.begin(); ctx.fillStyle = `rgba(0,0,0, ${opts.clear})`; ctx.fillRect(0,0, w,h); ctx.save(); //ctx.translate(w / 2+0.5 >> 0, h / 2+0.5 >> 0); let cols = opts.cols; let size = w/cols; let rows = Math.floor( h/size ); ctx.beginPath(); ctx.strokeStyle = '#0f0'; for(let j=0; j<rows; ++j){ for(let i=0; i<cols; ++i){ let x = size * i let y = size * j; let a = opts.startAngle + Math.sin( (i + startX*cols)*opts.mx + (j + startY*cols)*opts.my )*opts.angle; let xd = Math.cos(a)*size; let yd = Math.sin(a)*size; if( opts.leftAnchor ){ ctx.moveTo(x, y); ctx.lineTo(x+xd, y+yd); }else{ ctx.moveTo(x-xd/2, y-yd/2); ctx.lineTo(x+xd/2, y+yd/2); } } } ctx.stroke(); ctx.restore(); for(var i=0; i<gui.__controllers.length && opts.random; ++i){ var t = gui.__controllers[i]; if(!t.random) continue; t.setValue( opts[t.property]*(1-opts.speed) + t.newValue*opts.speed ); } requestAnimationFrame(loop); stats.end(); } /* if( you.read(code.bellow) && you.strenght != strong ) you.eye.setStatus(bleeding); ==== let's begin. ==== */ stats = new Stats(); stats.showPanel( 0 ); stats.domElement.style.position = 'absolute'; document.body.appendChild( stats.domElement ); //let panel = stats.addPanel( new Stats.Panel( 'caption', '#ff8', '#221' ) ); // panel.update(value, maxValue); /* i love DOM */ canvas = document.createElement('canvas'); document.body.appendChild(canvas); document.body.style.padding = '0px'; document.body.style.margin = '0px'; document.body.style.overflow = 'hidden'; /* i love full screen */ function resize(){ w = canvas.width = window.innerWidth; h = canvas.height = window.innerHeight; vmin = Math.min(w,h); vr = vmin / 2; } resize(); window.addEventListener('resize', resize, false); ctx = canvas.getContext('2d'); /* i love bad short opts ^__^ like q or qwe */ gui = new dat.GUI(); function opt(name, value, min, max){ opts[name] = value; return gui.add(opts, name, min, max); } gui.close(); // i make it for you... init(); function random(){ for(var i=0; i<gui.__controllers.length; ++i){ var t = gui.__controllers[i]; if(!t.random) continue; if( t.oldValue === undefined ) t.oldValue = opts[t.property]; t.newValue = (t.__max-t.__min) * Math.random() + t.__min; } } setInterval(random, 1000); random(); loop();
}, false);
Developer | Findoff |
Username | findoff |
Uploaded | October 03, 2022 |
Rating | 4 |
Size | 2,827 Kb |
Views | 36,432 |
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 |
Ant | 2,365 Kb |
A Pen by findoff | 2,637 Kb |
Screeps body calculator | 6,315 Kb |
Through penises... | 2,057 Kb |
Flawed text | 2,280 Kb |
Elementary cellular automaton | 2,685 Kb |
Flamethrower | 2,654 Kb |
Something with rockets | 3,513 Kb |
Let it snow | 2,600 Kb |
Small orbitals | 2,218 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 |
Loading animation - freedom purchase | Rocbear | 2,567 Kb |
Minimelephant | Smashlee | 2,507 Kb |
Incremental game | Eprouver | 5,868 Kb |
Flexbox Grid - equal height | DaveOrDead | 2,855 Kb |
Segments mouse following | Nosir | 2,909 Kb |
Cloud upload | Jaflo | 2,774 Kb |
Flexbox playground | Enxaneta | 5,418 Kb |
Scroll to view if element partially out of view port height | ChrisMaki | 2,104 Kb |
CSS Grid Overlay | Cliffpyles | 3,090 Kb |
Slider css only | Armandobau | 2,161 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!