Conical Helix

Developer
Size
2,196 Kb
Views
40,480

How do I make an conical helix?

Beautiful background gradient from http://codepen.io/Zeaklous/pen/mVEwje - a pen by Zach Saucier. What is a conical helix? How do you make a conical helix? This script and codes were developed by Gabi on 22 August 2022, Monday.

Conical Helix Previews

Conical Helix - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Conical Helix</title> <link rel="stylesheet" href="css/style.css">
</head>
<body> <canvas id="c"></canvas> <script src="js/index.js"></script>
</body>
</html>

Conical Helix - Script Codes CSS Codes

* { margin: 0; padding: 0; overflow: hidden; background: radial-gradient(#B8BEB4, #71685F);
}

Conical Helix - Script Codes JS Codes

var c = document.getElementById("c");
var ctx = c.getContext("2d");
var cw = c.width = window.innerWidth, cx = cw / 2;
var ch = c.height = window.innerHeight, cy = 2 * ch / 3;
var frames = 0;
var requestId = null;
var rad = (Math.PI / 180);
var r = 30, x, y;
function Draw() { frames++; var a = frames * rad; ctx.clearRect(0, 0, cw, ch); for (var i = 1; i < 360; i += .5) { var t = i * rad; ctx.beginPath(); x = cx + r * t * Math.cos(6 * t + a); y = cy + (r / 2) * Math.sin(a) * t * Math.sin(6 * t + a) - (r + r / 2 * (Math.cos(a))) * t; ctx.arc(x, y, i / 21, 0, 2 * Math.PI); ctx.fillStyle = Grd(x, y, i / 21, i * 6, i / 3.6) ctx.fill(); } requestId = window.requestAnimationFrame(Draw);
}
function Grd(x, y, r, hue, l) { grd = ctx.createRadialGradient(x - r / 2, y - r / 2, 0, x, y, r); grd.addColorStop(0, 'hsla(' + hue + ', 99%,' + l + '%,1)'); grd.addColorStop(1, 'hsla(' + hue + ', 99%,' + l + '%, 0.6)'); return grd;
}
var init = function() { if (requestId) { window.cancelAnimationFrame(requestId); requestId = null; } cw = c.width = window.innerWidth, cx = cw / 2; ch = c.height = window.innerHeight, cy = 2 * ch / 3; frames = 0; rad = (Math.PI / 180); r = 30, x, y; Draw();
}
setTimeout(function() { init(); addEventListener('resize', init, false);
}, 15);
Conical Helix - Script Codes
Conical Helix - Script Codes
Home Page Home
Developer Gabi
Username enxaneta
Uploaded August 22, 2022
Rating 4.5
Size 2,196 Kb
Views 40,480
Do you need developer help for Conical Helix?

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!

Gabi (enxaneta) Script Codes
Create amazing blog posts with AI!

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!