A Pen by Isaac Dettman on CodePen.
Created
May 16, 2019 04:19
-
-
Save idettman/a305bb53bf31a1233b4748a217740793 to your computer and use it in GitHub Desktop.
orthoplex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <canvas id='canv'></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var c = document.getElementById('canv'), | |
| $ = c.getContext('2d'), | |
| w = c.width = window.innerWidth, | |
| h = c.height = window.innerHeight, | |
| t = 0, num = 350, | |
| s, a, b, | |
| x, y, _x, _y, | |
| _t = 1 / 60; | |
| var anim = function() { | |
| $.fillStyle = 'hsla(0, 0%, 90%, 1)'; | |
| $.fillRect(0, 0, w, h); | |
| for (var i = 0; i < 1; i++) { | |
| x = 0; | |
| $.beginPath(); | |
| for (var j = 0; j < num; j++) { | |
| x += .95 * Math.sin(16); | |
| y = x * Math.sin(i + 3.0 * t + x /50)/.5; | |
| _x = x * Math.cos(b) - y * Math.sin(b); | |
| _y = x * Math.sin(b) + y * Math.cos(b); | |
| b = (j) * Math.PI / 1.99; | |
| $.lineWidth = .2; | |
| $.lineTo(w / 2- _x, h / 2 -_y); | |
| } | |
| $.strokeStyle = 'hsla(0,0%,0%,1)'; | |
| $.stroke(); | |
| } | |
| t += _t; | |
| window.requestAnimationFrame(anim); | |
| }; | |
| anim(); | |
| window.addEventListener('resize', function() { | |
| c.width = w = window.innerWidth; | |
| c.height = h = window.innerHeight; | |
| }, false); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| body { | |
| background: hsla(0, 0%, 90%, 1); | |
| margin: 0; | |
| width: 100%; | |
| overflow: hidden; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment